vim-nerdtree-tabs
vim-nerdtree-tabs copied to clipboard
Open NERDTreeTabs automatically when vim starts up if no files were specified.
The NERDTreeTabs is a awesome plugin, I like it very much. But I have a question. I want to open NERDTreeTabs automatically when vim starts up if no files were specified. Therefore, I write the code below. But it don't work. Vim open NERDTree but not NERDTreeTabs. Why? And is there other solution?
autocmd StdinReadPre * let s:std_in = 1
autocmd VimEnter * if argc() == 0 && !exists('s:std_in') | execute ':NERDTreeTabsOpen' | endif
Facing the same issue! Help greatly appreciated.
As a work around, you can use vim .
-- note the .
after vim. This will open the current directory in NERDTree.
This worked for me:
au VimEnter NERD_tree_1 enew | execute 'NERDTree '.argv()[0] | let g:nerdtree_tabs_open_on_console_startup=1
That way if you open a directory instead of a file (e.g. vim .
) NERDTree should open automatically and NERDTreeTabs should be enabled.