Skip to content

Commit

Permalink
feat: repeat map for smerge (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
terlar authored Jul 26, 2024
1 parent 8848419 commit 4d08887
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions init.org
Original file line number Diff line number Diff line change
Expand Up @@ -771,22 +771,17 @@ Shorten long Git branch names as well as replace Git prefix with a nice icon.

** Next/Previous
#+begin_src emacs-lisp :tangle yes
(autoload 'smerge-next "smerge-mode")
(autoload 'smerge-prev "smerge-mode")

(defvar-keymap next-map
:doc "Keymap for the next key sequences."
:prefix 'next-map-prefix
"b" '("Buffer" . next-buffer)
"c" '("Conflict" . smerge-next)
"e" '("Error" . next-error))
(keymap-global-set next-prefix 'next-map-prefix)

(defvar-keymap prev-map
:doc "Keymap for the prev key sequences."
:prefix 'prev-map-prefix
"b" '("Buffer" . previous-buffer)
"c" '("Conflict" . smerge-prev)
"e" '("Error" . previous-error))
(keymap-global-set prev-prefix 'prev-map-prefix)
#+end_src
Expand Down Expand Up @@ -2248,6 +2243,29 @@ Open link to files in the web UI connected to a repository.
(:map vc-prefix-map ("SPC" . browse-at-remote-kill)))
#+end_src

#+begin_src emacs-lisp :tangle yes
(use-package smerge-mode
:bind
(:repeat-map smerge-repeat-map
("[" . smerge-prev)
("]" . smerge-next)
("n" . smerge-next)
("p" . smerge-prev)

("RET" . smerge-keep-current)
("a" . smerge-keep-all)
("b" . smerge-keep-base)
("l" . smerge-keep-lower)
("u" . smerge-keep-upper)

("E" . smerge-ediff)
("r" . smerge-resolve)
("R" . smerge-refine))
:init
(setq smerge-command-prefix (kbd "C-x c"))
(keymap-set toggle-map "m" '("Merging" . smerge-mode)))
#+end_src

*** diff
#+begin_src emacs-lisp :tangle yes
(use-package diff
Expand Down

0 comments on commit 4d08887

Please sign in to comment.