I am learning Dired in Evil mode.
h
j
k
l
/
are Evil keys that obviously work in Dired.
Are there others?
Is there a table of Evil keys for Dired?
I am using Emacs 25.2.1 with Evil, Spacemacs, and Ivy.
I am learning Dired in Evil mode.
h
j
k
l
/
are Evil keys that obviously work in Dired.
Are there others?
Is there a table of Evil keys for Dired?
I am using Emacs 25.2.1 with Evil, Spacemacs, and Ivy.
Here are a few things you can try to see available keys:
?
-- actually this is partly wrong because
SPC ? dired
F1 m
(describe-mode
)
SPC h SPC dired
-- this lets you jump to the code for the layer that configures dired, spacemacs-base
, which for key bindings purposes is mostly about keys to run dired rather than once you're using dired
Here are some dired keys I find useful (in fact nearly all are the same as in stock emacs, so you can also just read the info page with F1 i
and much of it will correct key bindings still -- follow menus using m
to go to Emacs -> Dired).
Note that 'marking' files lets you operate on multiple files at once when e.g. copying or moving files.
RET
or f
Open file or directoryo
Open file in a separate window^
Up directory+
Create a directoryR
Rename / moveC
CopyM
Change file/directory mode (unix file/directory permissions)d
Deletem
Marku
Unmark / undeletex
'Expunge' -- i.e. actually delete files/directories marked for deletionI found it more helpful to approach this the other way around - what are the conflicts between Evil and Dired?
If we with Dired buffers in Evil's motion state (you can get this to be the default with (add-to-list 'evil-motion-state-modes 'dired-mode)
in your config) we get a familiar, vi-like baseline.
Then we just need a list of what we "lose" - keys in Dired that are shadowed by Evil's motion keys, and what functions they are bound to:
Key | Dired function | Notes |
---|---|---|
B |
dired-do-byte-compile |
|
e |
dired-find-file |
also bound on RET and f |
f |
dired-find-file |
also bound on RET and e |
F |
dired-do-find-marked-files |
|
g |
revert-buffer |
|
G |
dired-do-chgrp |
|
h |
describe-mode |
also bound on C-h m |
H |
dired-do-hardlink |
|
j |
dired-goto-file |
|
k |
dired-do-kill-lines |
|
l |
dired-do-redisplay |
|
L |
dired-do-load |
|
M |
dired-do-chmod |
|
n |
dired-next-line |
|
N |
dired-man |
|
t |
dired-toggle-marks |
|
T |
dired-do-touch |
|
v |
dired-view-file |
|
V |
dired-do-run-mail |
|
w |
dired-copy-filename-as-kill |
|
W |
browse-url-of-dired-file |
|
y |
dired-show-file-type |
|
Y |
dired-do-relsymlink |
|
! |
dired-do-shell-command |
|
# |
dired-flag-auto-save-files |
|
$ |
dired-hide-subdir |
|
% |
prefix to another keymap | many commands - transforming filenames, regex-involving operations, etc |
^ |
dired-up-directory |
|
* |
prefix to another keymap | many commands - related to Dired's marks |
( |
dired-hide-details-mode |
|
- |
negative-argument |
|
+ |
dired-create-directory |
|
: |
prefix to another keymap | just four GPG functions (epa-dired / "EasyPG Assistant") |
? |
dired-summary |
|
RET |
dired-find-file |
also bound on e and f |
C-u |
universal-argument |
Evil only shadows this if configured to |
C-v |
scroll-up-command |
So with that starting point, you can just look at the standard Dired and Dired Extra documentation to learn what all the other keys do.
(Besides C-d
, C-u
, C-v
, I didn't check modified keys for collisions between Evil motion state and Dired. I think vi/vim/Evil only use Ctrl-modified keys though, and only some of those are motions.)