emacs/dired: don't enable dired-git-info in ranger

It won't correctly disable on `C-c C-e`, but it does work find if
enabled manually.

Also: refactors +dired-enable-git-info-h and map! call

Relevant to #2106
This commit is contained in:
Henrik Lissner 2019-11-24 14:16:46 -05:00
parent 768d5b718c
commit b8c0126f8c
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 9 additions and 10 deletions

View file

@ -7,10 +7,9 @@
(mapc #'kill-buffer (doom-buffers-in-mode 'dired-mode))
(message "Killed all dired buffers"))
;;;###autoload
(defun +dired-enable-git-info-h ()
(if (and
(not (file-remote-p default-directory))
(locate-dominating-file "." ".git"))
"Enable `dired-git-info-mode' in git repos."
(and (not (file-remote-p default-directory))
(locate-dominating-file "." ".git")
(dired-git-info-mode 1)))

View file

@ -165,8 +165,7 @@ we have to clean it up ourselves."
("\\.\\(?:mp3\\|flac\\)\\'" ,cmd)
("\\.html?\\'" ,cmd)
("\\.md\\'" ,cmd))))
(map!
:map dired-mode-map
(map! :map dired-mode-map
:localleader
"h" #'dired-omit-mode))
@ -180,7 +179,8 @@ we have to clean it up ourselves."
(use-package! dired-git-info
:after dired
:init
(add-hook 'dired-after-readin-hook '+dired-enable-git-info-h)
(unless (featurep! +ranger)
(add-hook 'dired-after-readin-hook '+dired-enable-git-info-h))
:config
(map! :map (dired-mode-map ranger-mode-map)
:ng ")" #'dired-git-info-mode)