Merge pull request #1711 from ztlevi/dired
emacs/dired: use diff-hl instead of dired-k
This commit is contained in:
commit
075bc1797b
2 changed files with 9 additions and 24 deletions
|
@ -45,30 +45,14 @@
|
|||
:hook (dired-mode . diredfl-mode))
|
||||
|
||||
|
||||
(use-package! dired-k
|
||||
:hook (dired-initial-position . dired-k)
|
||||
:hook (dired-after-readin . dired-k-no-revert)
|
||||
(use-package! diff-hl
|
||||
:hook (dired-mode . diff-hl-dired-mode)
|
||||
:init
|
||||
(when (featurep! :tools magit)
|
||||
(add-hook 'magit-post-refresh-hook #'diff-hl-magit-post-refresh))
|
||||
:config
|
||||
(setq dired-k-style 'git
|
||||
dired-k-padding 1)
|
||||
|
||||
;; Don't highlight based on mtime, this interferes with diredfl and is more
|
||||
;; confusing than helpful.
|
||||
(advice-add #'dired-k--highlight-by-file-attribyte :override #'ignore)
|
||||
|
||||
(defadvice! +dired--interrupt-process-a (orig-fn &rest args)
|
||||
"Fixes dired-k killing git processes too abruptly, leaving behind disruptive
|
||||
.git/index.lock files."
|
||||
:around #'dired-k--start-git-status
|
||||
(cl-letf (((symbol-function #'kill-process)
|
||||
(symbol-function #'interrupt-process)))
|
||||
(apply orig-fn args)))
|
||||
|
||||
(defadvice! +dired--dired-k-highlight-a (orig-fn &rest args)
|
||||
"Butt out if the requested directory is remote (i.e. through tramp)."
|
||||
:around #'dired-k--highlight
|
||||
(unless (file-remote-p default-directory)
|
||||
(apply orig-fn args))))
|
||||
;; use margin instead of fringe
|
||||
(diff-hl-margin-mode))
|
||||
|
||||
|
||||
(use-package! ranger
|
||||
|
@ -117,6 +101,7 @@ we have to clean it up ourselves."
|
|||
|
||||
|
||||
(use-package! dired-x
|
||||
:unless (featurep! +ranger)
|
||||
:hook (dired-mode . dired-omit-mode)
|
||||
:config
|
||||
(setq dired-omit-verbose nil)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
;;; emacs/dired/packages.el
|
||||
|
||||
(package! diredfl)
|
||||
(package! dired-k)
|
||||
(package! diff-hl)
|
||||
(package! dired-rsync)
|
||||
(when (featurep! +ranger)
|
||||
(package! ranger))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue