doomemacs/modules/emacs/vc/autoload/hydra.el
Michael Peyton Jones bab4c921c8
tweak(vc): smerge-next -> smerge-vc-next-conflict
This is provided by `smerge-mode` in Emacs 27, and functions exactly
like `smerge-next`, except that if there are no more conflicts in the
current file, it will go to the next file with conflicts.

Arguably this could be a different key binding. However, I find that it
is almost strictly superior to `smerge-next`: I can't think of a case
where I *wouldn't* immediately want to go to the next file with
conflicts, and even if you do by accident you can just pop back to the
preceding buffer. So I think it warrants being the default.

Close: #5431
2023-03-22 18:22:47 -04:00

44 lines
2 KiB
EmacsLisp

;;; emacs/vc/autoload/hydra.el -*- lexical-binding: t; -*-
;;;###if (modulep! :ui hydra)
;;;###autoload (autoload '+vc/smerge-hydra/body "emacs/vc/autoload/hydra" nil t)
(defhydra +vc/smerge-hydra (:hint nil
:pre (if (not smerge-mode) (smerge-mode 1))
;; Disable `smerge-mode' when quitting hydra if
;; no merge conflicts remain.
:post (smerge-auto-leave))
"
[smerge]
Movement Keep Diff Other
╭─────────────────────────────────────────────────────────╯
^_g_^ [_b_] base [_<_] upper/base [_C_] Combine
^_C-k_^ [_u_] upper [_=_] upper/lower [_r_] resolve
^_k_ ↑^ [_l_] lower [_>_] base/lower [_R_] remove
^_j_ ↓^ [_a_] all [_H_] hightlight [_n_] next in project
^_C-j_^ [_RET_] current [_E_] ediff ╭──────────
^_G_^ │ [_q_] quit
"
("g" (progn (goto-char (point-min)) (smerge-next)))
("G" (progn (goto-char (point-max)) (smerge-prev)))
("C-j" smerge-vc-next-conflict)
("C-k" smerge-prev)
("j" next-line)
("k" previous-line)
("b" smerge-keep-base)
("u" smerge-keep-upper)
("l" smerge-keep-lower)
("a" smerge-keep-all)
("RET" smerge-keep-current)
("\C-m" smerge-keep-current)
("<" smerge-diff-base-upper)
("=" smerge-diff-upper-lower)
(">" smerge-diff-base-lower)
("H" smerge-refine)
("E" smerge-ediff)
("C" smerge-combine-with-next)
("r" smerge-resolve)
("R" smerge-kill-current)
;; Often after calling `smerge-vc-next-conflict', the cursor will land at
;; the bottom of the window
("n" (progn (smerge-vc-next-conflict) (recenter-top-bottom (/ (window-height) 8))))
("q" nil :color blue))