vim-nerdtree-tabs icon indicating copy to clipboard operation
vim-nerdtree-tabs copied to clipboard

Open NERDTreeTabs automatically when vim starts up if no files were specified.

Open QMonkey opened this issue 9 years ago • 3 comments

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

QMonkey avatar Jan 17 '16 03:01 QMonkey

Facing the same issue! Help greatly appreciated.

samirotiv avatar Mar 01 '16 21:03 samirotiv

As a work around, you can use vim . -- note the . after vim. This will open the current directory in NERDTree.

kierun avatar Jan 10 '17 10:01 kierun

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.

jimafisk avatar Sep 01 '17 17:09 jimafisk