If you happen to use Spacemacs, I'd recommend activating "smerge-transient-state", which brings up a hydra menu with all possible smerge commands. ![]() Note that I am using buffer-list-update-hook and not find-file-hook since most of the times I get conflicts in a buffer which is already open in emacs in which case find-file-hook is of no help.Īlso check other methods mentioned in this answer. ![]() (add-hook 'buffer-list-update-hook #'my-enable-smerge-maybe) (when (and buffer-file-name (vc-backend buffer-file-name)) UPDATE: The following is relevant only on Emacs versions before 25.1, the following can cause problems on later versions, see Īdditionally you might be interested in automatically enabling smerge-mode when visiting a file/buffer with conflict markers you can use something like the following to achieve this (defun my-enable-smerge-maybe () This is same as vc-resolve-conflicts (thanks and for pointing this out).
0 Comments
Leave a Reply. |