update FAQ about opening nerdtree automatically on startup

Closes #494
This commit is contained in:
Martin Grenfell 2015-11-26 18:57:38 +00:00
parent fddac60afb
commit 73ded483a0

View File

@ -91,11 +91,13 @@ Stick this in your vimrc: `autocmd vimenter * NERDTree`
> How can I open a NERDTree automatically when vim starts up if no files were specified? > How can I open a NERDTree automatically when vim starts up if no files were specified?
Stick this in your vimrc Stick this in your vimrc:
autocmd StdinReadPre * let s:std_in=1 autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
Note: Now start vim with plain `vim`, not `vim .`
> How can I map a specific key or shortcut to open NERDTree? > How can I map a specific key or shortcut to open NERDTree?
Stick this in your vimrc to open NERDTree with `Ctrl+n` (you can set whatever key you want): Stick this in your vimrc to open NERDTree with `Ctrl+n` (you can set whatever key you want):