diff options
author | David Robillard <d@drobilla.net> | 2024-09-04 14:04:04 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2024-09-04 14:13:27 -0400 |
commit | e7506f4e5d5e2d270280675d4f866eb33a32dca2 (patch) | |
tree | 771868a9e0e4d8a32d288e4b3cb6664c2128a891 /emacs | |
parent | e7b1cc1388bb1e7277fbd0c389545a58dce70aea (diff) | |
download | dotfiles-e7506f4e5d5e2d270280675d4f866eb33a32dca2.tar.gz dotfiles-e7506f4e5d5e2d270280675d4f866eb33a32dca2.tar.bz2 dotfiles-e7506f4e5d5e2d270280675d4f866eb33a32dca2.zip |
Always try to open files in smerge mode
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs/.emacs.d/init.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index 95ea94b..c14287b 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -142,6 +142,16 @@ (add-hook 'magit-pre-refresh-hook 'diff-hl-magit-pre-refresh) (add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh) +;; Always try to open files in smerge mode if they seem to have conflicts +(defun smerge-try-smerge () + (save-excursion + (goto-char (point-min)) + (when (re-search-forward "^<<<<<<< " nil t) + (require 'smerge-mode) + (smerge-mode 1)))) +(add-hook 'find-file-hook 'smerge-try-smerge t) +(add-hook 'after-revert-hook 'smerge-try-smerge t) + ;;; Variables (custom-set-variables |