Skip to content

Commit

Permalink
feat(dired): add +dirvish option
Browse files Browse the repository at this point in the history
Fix: #6397
  • Loading branch information
zrquan committed Jun 23, 2022
1 parent 8df91f0 commit 1e6d5c3
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
25 changes: 25 additions & 0 deletions modules/emacs/dired/config.el
Expand Up @@ -136,8 +136,32 @@ we have to clean it up ourselves."
ranger-hide-cursor nil))


(use-package! dirvish
:when (featurep! +dirvish)
:defer t
:init (after! dired (dirvish-override-dired-mode))
:hook (dired-mode . dired-omit-mode)
:config
(setq dirvish-cache-dir (concat doom-cache-dir "dirvish/")
dirvish-hide-details nil
dirvish-attributes '(git-msg)
dired-omit-files (concat dired-omit-files "\\|^\\..*$"))
(when (featurep! +icons)
(push 'all-the-icons dirvish-attributes))
(map! :map dirvish-mode-map
:n "b" #'dirvish-goto-bookmark
:n "z" #'dirvish-show-history
:n "f" #'dirvish-file-info-menu
:n "F" #'dirvish-toggle-fullscreen
:n "l" #'dired-find-file
:n "h" #'dired-up-directory
:localleader
"h" #'dired-omit-mode))


(use-package! all-the-icons-dired
:when (featurep! +icons)
:unless (featurep! +dirvish)
:hook (dired-mode . all-the-icons-dired-mode)
:config
;; HACK Fixes #1929: icons break file renaming in Emacs 27+, because the icon
Expand All @@ -160,6 +184,7 @@ we have to clean it up ourselves."


(use-package! dired-x
:unless (featurep! +dirvish)

This comment has been minimized.

Copy link
@teehemkay

teehemkay Jul 12, 2022

Any reason for disabling dired-x when using dirvish?
I'm asking because of an (void-variable dired-omit-files) issue I'm constantly getting which prevents opening any file in emacs. The error seems to be triggered by line 148 above (at least it disappears when I remove that line) and as far as I could tell dired-omit-files is defined in dired-x...
FWIW I've (unpin dirvish) to use the latest version.

This comment has been minimized.

Copy link
@elken

elken Jul 12, 2022

Contributor

Please file an issue rather than commenting on a commit (it does look like you're correct though)

:unless (featurep! +ranger)
:hook (dired-mode . dired-omit-mode)
:config
Expand Down
5 changes: 4 additions & 1 deletion modules/emacs/dired/packages.el
Expand Up @@ -7,6 +7,9 @@
(package! dired-rsync :pin "7940d9154d0a908693999b0e1ea351a6d365c93d")
(when (featurep! +ranger)
(package! ranger :pin "2498519cb21dcd5791d240607a72a204d1761668"))
(when (featurep! +icons)
(when (featurep! +dirvish)
(package! dirvish :pin "73dcaa404da9ab84d25f2919e6e3af4b1f8e7f37"))
(when (and (featurep! +icons)
(not (featurep! +dirvish)))
(package! all-the-icons-dired :pin "5e9b097f9950cc9f86de922b07903a4e5fefc733"))
(package! fd-dired :pin "458464771bb220b6eb87ccfd4c985c436e57dc7e")

0 comments on commit 1e6d5c3

Please sign in to comment.