Skip to content

Instantly share code, notes, and snippets.

@jansanchez
Created August 8, 2013 23:07
Show Gist options
  • Save jansanchez/6189664 to your computer and use it in GitHub Desktop.
Save jansanchez/6189664 to your computer and use it in GitHub Desktop.
How do you add NERDTree to your vimrc
Okay, the previous version was a bit terse, but the answer you're looking for is to add the line below into your ~/.vimrc file. It tells vim that you want to setup a command to run when vim starts, but since it depends on various plugins to be loaded, you don't want to run it until all initialization is finished. The line below does this.
autocmd VimEnter * NERDTree
If, however, you're annoyed by the fact that the cursor always starts in the NERDTree window, you can add a second autocommand that will move the cursor into the main window, like so:
autocmd VimEnter * NERDTree
autocmd VimEnter * wincmd p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment