3

I'm a Colemak keyboard layout user and I recently started to learn and use Vim.

I was able to map the arrow keys in the normal mode by putting custom mappings such as noremap u k in .vimrc (because the keys h, j, k, and i are in different places in the Colemak layout).

However, when I tried to use NERDTree, navigating through the NERDTree menu became very hard for me for I have to reach j and k key to navigate up and down (those keys are y and k in QWERTY).

Is there a way to map those two keys into other keys?

I would really appreciate any help!

1 Answer 1

4

if you look at the documentation (:help NERDTree-t), you'll see that each of the command have a name and a default key.

To remap for example NERDTreeMapUpdir to the 'a' key, you just have to add to you .vimrc:

let NERDTreeMapUpdir='a'
2
  • 1
    It worked! Thank you so much! It wasn't working when I tried to set let NERDTreeMenuDown = "e" and the reason was that the key e has been bound to something else, so by setting the NERDTreeMapOpenExpl to some other key solved the issue.
    – David
    Commented Apr 20, 2019 at 20:18
  • sidenote: when I made the change instantly in :ex, like :let NERD...='x' this didn't work. Also changing this in vimrc and then :source it didn't work. Somehow I had to restart vim for the change in vimrc to take effect
    – MacMartin
    Commented May 17, 2021 at 13:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.