4
4
#+since: 2.0.0
5
5
6
6
* Description :unfold:
7
- This module provides reasonable defaults and augmentations for dired.
7
+ This module provides reasonable defaults and augmentations for [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html][Dired]], the
8
+ inbuilt file manager for Emacs. The extra features are mostly introduced by the
9
+ Dired enhancement package [[https://github.com/alexluigit/dirvish][Dirvish]].
8
10
9
11
** Maintainers
10
- /This module has no dedicated maintainers./ [[doom-contrib-maintainer:][Become a maintainer?]]
12
+ - [[doom-user:][@alexluigit]]
13
+
14
+ [[doom-contrib-maintainer:][Become a maintainer?]]
11
15
12
16
** Module flags
13
17
- +icons ::
14
18
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]].
19
+ - +dirvish ::
20
+ Apply some stylistic defaults to the Dired buffer.
21
+ + Show file size at right fringe
22
+ + Collapse directories with only one entry in it automatically.
23
+ + Use prettified header line and mode line
24
+ + Hide file details information by default
25
+ + Enable line highlighting, hide the cursor
17
26
18
27
** Packages
19
- - [[doom-package:][all-the-icons-dired]] if [[doom-module:][+icons]]
20
- - [[doom-package:][diff-hl]]
28
+ - [[doom-package:][dirvish]]
21
29
- [[doom-package:][diredfl]]
22
- - [[doom-package:][dired-rsync]]
23
- - [[doom-package:][fd-dired]]
24
- - [[doom-package:][ranger]] if [[doom-module:][+ranger]]
25
30
26
31
** TODO Hacks
27
32
#+begin_quote
@@ -38,29 +43,125 @@ This module provides reasonable defaults and augmentations for dired.
38
43
This module has no requirements *except on BSDs* like MacOS or FreeBSD, where
39
44
=GNU ls= (aka ~gls~) is required.
40
45
41
- * TODO Usage
42
- #+begin_quote
43
- 🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
44
- #+end_quote
45
-
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]] |
52
-
53
- Other keybindings can be found on the official [[https://www.gnu.org/software/emacs/refcards/pdf/dired-ref.pdf][Dired reference card]].
54
-
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
-
60
- * TODO Configuration
61
- #+begin_quote
62
- 🔨 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]]
63
- #+end_quote
46
+ Optionally, install these dependencies to improve the preview experience:
47
+
48
+ + =imagemagick= for image preview
49
+ + =poppler= | =pdf-tools= for pdf preview
50
+ + =ffmpegthumbnailer= for video preview
51
+ + =mediainfo= for audio/video metadata generation
52
+ + =tar= and =unzip= for archive files preview
53
+
54
+ ** macOS
55
+ #+begin_src bash
56
+ brew install coreutils fd poppler ffmpegthumbnailer mediainfo imagemagick
57
+ #+end_src
58
+
59
+ ** Debian-based
60
+ #+begin_src bash
61
+ apt install fd-find poppler-utils ffmpegthumbnailer mediainfo imagemagick tar unzip
62
+ #+end_src
63
+
64
+ ** Arch-based
65
+ #+begin_src bash
66
+ pacman -S fd poppler ffmpegthumbnailer mediainfo imagemagick tar unzip
67
+ #+end_src
68
+
69
+ ** FreeBSD
70
+ #+begin_src bash
71
+ pkg install gnuls fd-find poppler ffmpegthumbnailer ImageMagick7 gtar
72
+ #+end_src
73
+
74
+ ** Windows (not tested, may not work)
75
+ #+begin_src bash
76
+ # install via Scoop: https://scoop.sh/
77
+ scoop install coreutils fd poppler imagemagick unzip
78
+ #+end_src
79
+
80
+ * Usage
81
+ ** Global bindings
82
+ You can access Dired/Dirvish by opening a directory entry in commands like
83
+ ~find-file (SPC f f)~. Or you can create a Dired buffer directly with these
84
+ keybindings.
85
+
86
+ | Keybind | Description |
87
+ |------------------------------+------------------------------------|
88
+ | [[kbd:][SPC f d]] | Find directory with dired |
89
+ | [[kbd:][SPC o -]] | Jump to current directory in dired |
90
+
91
+ These commands are available but not bound to any keys.
92
+
93
+ | Command | Description |
94
+ |------------------+--------------------------------|
95
+ | [[kbd:][M-x dirvish]] | Open dired with preview |
96
+ | [[kbd:][M-x dirvish-dwim]] | Dirvish with smart layout |
97
+ | [[kbd:][M-x dirvish-fd]] | Search files in dired using fd |
98
+ | [[kbd:][M-x dirvish-side]] | Open project sidebar |
99
+
100
+ ** Dired bindings
101
+ *** Basics
102
+ Note that these are Emacs bindings, if you have enabled ~(evil
103
+ +everywhere)~, you should consult =evil-collection= for the actual bindings.
104
+
105
+ | Keybind | Description |
106
+ |---------+-------------------------------------------|
107
+ | [[kbd:][n]] | Move down a line |
108
+ | [[kbd:][p]] | Move up a line |
109
+ | [[kbd:][e]] | Visit the file or directory on this line |
110
+ | [[kbd:][(]] | Toggle visibility of detailed information |
111
+ | [[kbd:][q]] | Exit dired buffer |
112
+ | [[kbd:][^]] | Go Up a directory |
113
+ | [[kbd:][m]] | Mark a file |
114
+ | [[kbd:][u]] | Unmark a file |
115
+ | [[kbd:][D]] | Delete a file |
116
+ | ... | ... |
117
+
118
+ This is only a very small sample of dired keybindings, just for you to get a
119
+ sense of Dired. Other basic keybindings can be found on the official [[https://www.gnu.org/software/emacs/refcards/pdf/dired-ref.pdf][Dired
120
+ reference card]].
121
+
122
+ *** Extras
123
+ You don't have to memorize all of Dired bindings because this module provided a
124
+ lot of easy-to-read menus such as ~dirvish-mark-menu~ (powered by =transient.el=)
125
+ for you to find the suitable command in a specific context. All of these
126
+ (sub-)menus are included in ~dirvish-dispatch (?)~, the main help menu. Some
127
+ extremely useful ones are bound to a separate keys as well.
128
+
129
+ | Keybind | Description |
130
+ |---------+-----------------------------------------------|
131
+ | [[kbd:][?]] | Ask for help |
132
+ | [[kbd:][a]] | Quick access frequently used directories |
133
+ | [[kbd:][f]] | Get file information under the cursor |
134
+ | [[kbd:][y]] | Paste/link/move marked files here |
135
+ | [[kbd:][s]] | Sort buffer with different criteria |
136
+ | [[kbd:][M-m]] | Commands relate to marking and actions |
137
+ | [[kbd:][M-s]] | Setup user interface for dirvish |
138
+ | [[kbd:][M-e]] | "Emerge" important files at the top |
139
+
140
+ Other bindings in this module:
141
+
142
+ | [[kbd:][TAB]] | Expand or contract directory under the cursor |
143
+ | [[kbd:][M-f]] | Jump to next dired history entry |
144
+ | [[kbd:][M-b]] | Jump to previous dired history entry |
145
+ | [[kbd:][M-n]] | Narrow the buffer with user input |
146
+ | [[kbd:][M-t]] | Toggle fullscreen (preview) |
147
+ | [[kbd:][C-c C-e]] | Rename entries with [[doom-package:][wdired]] |
148
+
149
+ * Configuration
150
+ ** Quick access entries
151
+
152
+ Use the following syntax to configure the entries displayed in
153
+ ~dirvish-quick-access~ command.
154
+
155
+ #+begin_src emacs-lisp
156
+ ;; in $DOOMDIR/config.el
157
+ (setq! dirvish-quick-access-entries
158
+ `(("h" "~/" "Home")
159
+ ("e" ,user-emacs-directory "Emacs user directory")
160
+ ("c" "~/Code/" "Code")
161
+ ("d" "~/Downloads/" "Downloads")
162
+ ("m" "/mnt/" "Mounted drives")
163
+ ("t" "~/.local/share/Trash/files/" "Trash")))
164
+ #+end_src
64
165
65
166
* Troubleshooting
66
167
/There are no known problems with this module./ [[doom-report:][Report one?]]
0 commit comments