mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 11:23:48 -05:00
Update readme, trick to open NERDTree as a tab window.
This commit is contained in:
@@ -100,10 +100,14 @@ Stick this in your vimrc:
|
|||||||
|
|
||||||
Note: Now start vim with plain `vim`, not `vim .`
|
Note: Now start vim with plain `vim`, not `vim .`
|
||||||
|
|
||||||
Or use the following directives if you prefer using `vim .`:
|
|
||||||
|
---
|
||||||
|
> How can I open NERDTree as a tab window automatically when vim opens a directory?
|
||||||
|
|
||||||
autocmd StdinReadPre * let s:std_in=1
|
autocmd StdinReadPre * let s:std_in=1
|
||||||
autocmd VimEnter * if argc() == 1 && argv()[0] == '.' && !exists("s:std_in") | NERDTree | wincmd p | ene | endif
|
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | NERDTree | wincmd p | ene | endif
|
||||||
|
|
||||||
|
This trick also prevents NERDTree from hiding when first select a file.
|
||||||
|
|
||||||
---
|
---
|
||||||
> How can I open NERDTree on startup, and have my cursor start in the other window?
|
> How can I open NERDTree on startup, and have my cursor start in the other window?
|
||||||
|
|||||||
Reference in New Issue
Block a user