Skip to content

Commit df986b3

Browse files
committed
feat(dired): restructure the module based on dirvish
- Deprecate `+ranger` flag, use dirvish by default See: alexluigit/dirvish#34 - Bump the package version for diredfl and dirvish - Reimplement `+icons`, deprecate package all-the-icons-dired all-the-icons-dired is very slow on large directories, while dirvish render icons lazily. - Use `vc-state` from dirvish, remove diff-hl-dired-mode 1. diff-hl-dired-mode doesn't index the entries in subtrees. 2. It freezes Emacs on big repos, while dirvish does this asynchronously in external process and update the UI in an nonblocking fashion. - Use `git-msg` from dirvish, deprecate package dired-git-info Same reasons as in diff-hl-dired-mode. - Use utilities in dirvish-yank.el, deprecate package dired-rsync `dirvish-yank` has inbuilt support for rsync. - Use dirvish-fd, deprecate package fd-dired `dirvish-fd` is way powerful. - Remove the gnuls check on remote hosts dirvish checks gnu ls availability for each remote host. - Set `dired-hide-details-hide-symlink-targets` to t (default) We have symlink target showing on the modeline - Add a few sensible keybindings globally - Add `+bindings` flag for additional keybindings
1 parent 0172b18 commit df986b3

File tree

8 files changed

+145
-216
lines changed

8 files changed

+145
-216
lines changed

modules/config/default/+emacs-bindings.el

+6
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@
8181
:desc "Find file from here" "F" #'+default/find-file-under-here
8282
:desc "Locate file" "l" #'locate
8383
:desc "Rename/move this file" "m" #'doom/move-this-file
84+
(:when (modulep! :emacs dired)
85+
:desc "Find file names in dired" "n" #'dirvish-fd)
8486
:desc "Find file in private config" "p" #'doom/find-file-in-private-config
8587
:desc "Browse private config" "P" #'doom/open-private-config
8688
:desc "Recent files" "r" #'recentf-open-files
@@ -236,6 +238,10 @@
236238
:desc "REPL" "r" #'+eval/open-repl-other-window
237239
:desc "REPL (same window)" "R" #'+eval/open-repl-same-window
238240
:desc "Dired" "-" #'dired-jump
241+
(:when (modulep! :emacs dired)
242+
;; REVIEW: shall we bind dirvish-side here?
243+
;; :desc "Project sidebar" "p" #'dirvish-side
244+
:desc "Dired w/ preview" "v" #'dirvish)
239245
(:when (modulep! :ui neotree)
240246
:desc "Project sidebar" "p" #'+neotree/open
241247
:desc "Find file in project sidebar" "P" #'+neotree/find-this-file)

modules/config/default/+evil-bindings.el

+6
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,8 @@
431431
:desc "Find file" "f" #'find-file
432432
:desc "Find file from here" "F" #'+default/find-file-under-here
433433
:desc "Locate file" "l" #'locate
434+
(:when (modulep! :emacs dired)
435+
:desc "Find file names in dired" "n" #'dirvish-fd)
434436
:desc "Find file in private config" "p" #'doom/find-file-in-private-config
435437
:desc "Browse private config" "P" #'doom/open-private-config
436438
:desc "Recent files" "r" #'recentf-open-files
@@ -605,6 +607,10 @@
605607
:desc "REPL" "r" #'+eval/open-repl-other-window
606608
:desc "REPL (same window)" "R" #'+eval/open-repl-same-window
607609
:desc "Dired" "-" #'dired-jump
610+
(:when (modulep! :emacs dired)
611+
;; REVIEW: resolve conflict between dirvish-side and neotree/treemacs
612+
;; :desc "Project sidebar" "p" #'dirvish-side
613+
:desc "Dired w/ preview" "v" #'dirvish)
608614
(:when (modulep! :ui neotree)
609615
:desc "Project sidebar" "p" #'+neotree/open
610616
:desc "Find file in project sidebar" "P" #'+neotree/find-this-file)

modules/emacs/dired/README.org

+72-19
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,19 @@
77
This module provides reasonable defaults and augmentations for dired.
88

99
** Maintainers
10-
/This module has no dedicated maintainers./ [[doom-contrib-maintainer:][Become a maintainer?]]
10+
- [[doom-user:][@alexluigit]]
11+
12+
[[doom-contrib-maintainer:][Become a maintainer?]]
1113

1214
** Module flags
1315
- +icons ::
1416
Enables the display of fancy icons depending on file types in dired buffers.
15-
- +ranger ::
16-
Enables dired to be more like [[https://github.com/ranger/ranger][ranger]].
17+
- +bindings ::
18+
Enables some sensible keybindings in dired buffers, see below.
1719

1820
** Packages
19-
- [[doom-package:][all-the-icons-dired]] if [[doom-module:][+icons]]
20-
- [[doom-package:][diff-hl]]
21+
- [[doom-package:][dirvish]]
2122
- [[doom-package:][diredfl]]
22-
- [[doom-package:][dired-rsync]]
23-
- [[doom-package:][fd-dired]]
24-
- [[doom-package:][ranger]] if [[doom-module:][+ranger]]
2523

2624
** TODO Hacks
2725
#+begin_quote
@@ -38,25 +36,80 @@ This module provides reasonable defaults and augmentations for dired.
3836
This module has no requirements *except on BSDs* like MacOS or FreeBSD, where
3937
=GNU ls= (aka ~gls~) is required.
4038

39+
Optionally, you can install these dependencies to improve the preview
40+
experience:
41+
42+
+ =fd= as a faster alternative to =find=
43+
+ =imagemagick= for image preview
44+
+ =poppler= | =pdf-tools= for pdf preview
45+
+ =ffmpegthumbnailer= for video preview
46+
+ =mediainfo= for audio/video metadata generation
47+
+ =tar= and =unzip= for archive files preview
48+
49+
** macOS
50+
#+begin_src bash
51+
brew install coreutils fd poppler ffmpegthumbnailer mediainfo imagemagick
52+
#+end_src
53+
54+
** Debian-based
55+
#+begin_src bash
56+
apt install fd-find poppler-utils ffmpegthumbnailer mediainfo imagemagick tar unzip
57+
#+end_src
58+
59+
** Arch-based
60+
#+begin_src bash
61+
pacman -S fd poppler ffmpegthumbnailer mediainfo imagemagick tar unzip
62+
#+end_src
63+
64+
** FreeBSD
65+
#+begin_src bash
66+
pkg install gnuls fd-find poppler ffmpegthumbnailer ImageMagick7 gtar
67+
#+end_src
68+
69+
** Windows (not tested, may not work)
70+
#+begin_src bash
71+
# install via Scoop: https://scoop.sh/
72+
scoop install coreutils fd poppler imagemagick unzip
73+
#+end_src
74+
4175
* TODO Usage
4276
#+begin_quote
4377
🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
4478
#+end_quote
4579

46-
| Keybind | Description |
47-
|---------+----------------------------|
48-
| [[kbd:][SPC f d]] | Find directory with dired |
49-
| [[kbd:][q]] | Exit dired buffer |
50-
| [[kbd:][C-c C-r]] | Run [[doom-package:][dired-rsync]] |
51-
| [[kbd:][C-c C-e]] | Rename entries with [[doom-package:][wdired]] |
80+
** Global bindings
81+
| Keybind | Description |
82+
|---------+---------------------------|
83+
| [[kbd:][SPC f d]] | Find directory with dired |
84+
| [[kbd:][SPC f n]] | Find file names in dired |
85+
| [[kbd:][SPC o v]] | Open dired with preview |
86+
87+
** Dired/Dirvish bindings
88+
| Keybind | Description |
89+
|---------+-----------------------------|
90+
| [[kbd:][q]] | Exit dired buffer |
91+
| [[kbd:][?]] | Ask for help |
92+
| [[kbd:][M-t]] | Toggle fullscreen (preview) |
93+
| [[kbd:][C-c C-e]] | Rename entries with [[doom-package:][wdired]] |
94+
95+
If [[doom-module:][+bindings]] is enabled, these bindings are available as well.
96+
97+
| Keybind | Description |
98+
|---------+-----------------------------------------------|
99+
| [[kbd:][a]] | Quick access frequently used directories |
100+
| [[kbd:][f]] | Get file information under the cursor |
101+
| [[kbd:][y]] | Paste/link/move marked files here |
102+
| [[kbd:][s]] | Sort buffer with different criteria |
103+
| [[kbd:][TAB]] | Expand or contract directory under the cursor |
104+
| [[kbd:][M-f]] | Jump to next dired history entry |
105+
| [[kbd:][M-b]] | Jump to previous dired history entry |
106+
| [[kbd:][M-m]] | Mark files in different ways |
107+
| [[kbd:][M-s]] | Setup user interface for dirvish |
108+
| [[kbd:][M-n]] | Narrow the buffer with user input |
109+
| [[kbd:][C-c C-e]] | Rename entries with [[doom-package:][wdired]] |
52110

53111
Other keybindings can be found on the official [[https://www.gnu.org/software/emacs/refcards/pdf/dired-ref.pdf][Dired reference card]].
54112

55-
** Ranger
56-
If [[doom-module:][+ranger]] is enabled often a buffer will be opened in minimal ranger mode
57-
(~deer-mode~). In this case [[kbd:][z P]] can be used to toggle between full ranger and
58-
~deer-mode~.
59-
60113
* TODO Configuration
61114
#+begin_quote
62115
🔨 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]]

modules/emacs/dired/autoload.el

-15
This file was deleted.

0 commit comments

Comments
 (0)