Search code examples
vimcommand-linecommandnerdtree

Create a command shortcut for NERDTree in Vim editor


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?


Solution

  • In my .vimrc I have:

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

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