diff options
-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 |