summaryrefslogtreecommitdiff
path: root/.emacs
diff options
context:
space:
mode:
Diffstat (limited to '.emacs')
-rw-r--r--.emacs39
1 files changed, 33 insertions, 6 deletions
diff --git a/.emacs b/.emacs
index 545218b..af613f3 100644
--- a/.emacs
+++ b/.emacs
@@ -387,9 +387,6 @@
;;; Version control.
-(add-hook 'magit-pre-refresh-hook 'diff-hl-magit-pre-refresh)
-(add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh)
-
(add-hook 'git-commit-setup-hook 'git-commit-turn-on-flyspell)
(setq magit-process-finish-apply-ansi-colors t)
@@ -456,8 +453,6 @@
(setq truncate-lines nil)
(setq-local recenter-positions '(top middle bottom)))
-(add-hook 'dired-mode-hook 'diff-hl-dired-mode-unless-remote)
-
(add-to-list 'ibuffer-saved-filter-groups
'("my/ibuffer-groups"
("REPL"
@@ -683,6 +678,34 @@
(my/list-update package-archives
'(("melpa" . "https://melpa.org/packages/")))))
+(use-package diff-hl
+ :custom
+ (diff-hl-flydiff-mode t)
+ (global-diff-hl-mode t)
+
+ ;; FIXME: Adding to these hooks _here_ clobbers them, i.e. they end
+ ;; up containing (a) the diff-hl functions (b) whatever functions
+ ;; their libraries add dynamically (c) *none* of the functions
+ ;; included in the defcustom's default value.
+ ;;
+ ;; Therefore, set these hooks up in the :config form _for the
+ ;; libraries that define these hooks_, so that (presumably) the
+ ;; default values for these hooks are loaded *before* adding the
+ ;; diff-hl functions.
+ ;;
+ ;; :hook
+ ;; ((dired-mode . diff-hl-dired-mode-unless-remote)
+ ;; (magit-pre-refresh . diff-hl-magit-pre-refresh)
+ ;; (magit-post-refresh . diff-hl-magit-post-refresh))
+ )
+
+(use-package dired
+ :custom
+ (dired-kill-when-opening-new-dired-buffer t)
+ (dired-listing-switches "-al -Fhv --group-directories-first")
+ :config
+ (add-hook 'dired-mode-hook 'diff-hl-dired-mode-unless-remote))
+
(use-package ediff
:custom
(ediff-merge-split-window-function 'split-window-vertically)
@@ -738,7 +761,11 @@
(magit-define-global-key-bindings nil)
(magit-diff-refine-hunk t)
(magit-ediff-dwim-show-on-hunks t)
- (magit-revision-show-gravatars t))
+ (magit-revision-show-gravatars t)
+ :config
+ ;; See `diff-hl' form for rationale.
+ (add-hook 'magit-pre-refresh-hook 'diff-hl-magit-pre-refresh)
+ (add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh))
(use-package magit-blame
:delight "👉")