mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 11:23:48 -05:00
Fix opening current directory in NERDTree tab.
This commit is contained in:
@@ -102,10 +102,10 @@ Note: Now start vim with plain `vim`, not `vim .`
|
|||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
> How can I open NERDTree as a tab window automatically when vim opens a directory?
|
> How can I open NERDTree as a tab window automatically when vim starts up on opening a directory?
|
||||||
|
|
||||||
autocmd StdinReadPre * let s:std_in=1
|
autocmd StdinReadPre * let s:std_in=1
|
||||||
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | NERDTree | wincmd p | ene | endif
|
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif
|
||||||
|
|
||||||
This trick also prevents NERDTree from hiding when first select a file.
|
This trick also prevents NERDTree from hiding when first select a file.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user