Create a command shortcut for NERDTree in Vim editor

Jesse picture Jesse · Jun 24, 2011 · Viewed 31.1k times · Source

I'd like to create an abbreviation for NERDTree on the command-line. I find it annoying have to write :NERDTree every time I want to enable it. So I'd like to type :nr or something like that. Is that possible?

Answer

jamapag picture jamapag · Jun 24, 2011

In my .vimrc I have:

let mapleader = ","
nmap <leader>ne :NERDTree<cr>

So when I need NERDTree I just write ,ne in normal mode.