Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

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

Open
QMonkey opened this issue Jan 17, 2016 · 3 comments

Comments

@QMonkey
Copy link

QMonkey commented Jan 17, 2016

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
@samirotiv
Copy link

Facing the same issue! Help greatly appreciated.

@kierun
Copy link

kierun commented Jan 10, 2017

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

@jimafisk
Copy link

jimafisk commented Sep 1, 2017

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants