1

I'm looking for a way to navigate in dired/dired+ and evil mode by using 'h' 'j' 'k' 'l' like as in vim netrw. I've found some lisp phrases and applied those but those don't work at all.

For instance,

 
(eval-after-load 'dired
  '(progn
     ;; use the standard Dired bindings as a base
     (evil-make-overriding-map dired-mode-map 'normal t)
     (evil-define-key 'normal dired-mode-map
       "h" 'evil-backward-char
       "j" 'evil-next-line
       "k" 'evil-previous-line
       "l" 'evil-forward-char
       "r" 'dired-do-redisplay))) ; "l"

Emacs just runs 'dired-do-kill-lines' as if it doesn't recognize my configuration. Could you give me some configuration, please?

windrg00
  • 457
  • 3
  • 9
  • Take a look at `evil-add-hjkl-bindings`; there's an example of using it in dired-mode in evil-integration.el. In fact, evil lets you use hjkl in dired-mode by default, which makes me wonder if you're somehow in the wrong state. – Gordon Gustafson Oct 23 '15 at 15:01

1 Answers1

2

What if you press C-z until you put yourself in Normal mode (vim mode) ? I do that and I can use those keys to navigate. I use smart-mode-line to see what mode I am in (I don't recall what shows the default mode-line).

You can choose to enter Dired mode in Normal state: http://wikemacs.org/index.php/Evil#Enter_an_emacs_mode_in_a_given_state

Ehvince
  • 17,274
  • 7
  • 58
  • 79