Search code examples
emacsspacemacs

Rebind keys in Spacemacs for NeoTree buffer


I want to rebind movement keys in NeoTree buffer in Spacemacs. Looking at my other key bindings in dotspacemacs/user-config this should work:

(with-eval-after-load 'neotree
  (evil-define-key 'normal neotree-mode-map (kbd "i") 'neotree-previous-line)
  (evil-define-key 'normal neotree-mode-map (kbd "k") 'neotree-next-line))

but as far as I can see it does nothing. How should one do this? I wouldn't mind vanilla Emacs solution, but I'm more interested how Spacemacs binds keys. Thanks...


Solution

  • This answer is thanks to bmag at Github:

    (with-eval-after-load 'neotree
      (evil-define-key 'evilified neotree-mode-map (kbd "i") 'neotree-previous-line)
      (evil-define-key 'evilified neotree-mode-map (kbd "k") 'neotree-next-line))