简体   繁体   中英

how to make vim-nerdtree-tab auto start

I am the newer of vim, after installing the spf13, I got a problem.

I have installed the NERDTree and vim-NERDTree-tab, but I don'w know how to let vim-NERDTree-tab starts on every tabs I open in NERDTree, please help me for this question.

According to the documentation , this happens automatically in GVIM, but has to be enabled in terminal Vim:

 g:nerdtree_tabs_open_on_gui_startup (default: 1) Open NERDTree on gvim/macvim startup g:nerdtree_tabs_open_on_console_startup (default: 0) Open NERDTree on console vim startup 

So, if that's the case (and you've installed the plugins correctly), just put this into your ~/.vimrc (or the equivalent in spf-13 ):

:let g:nerdtree_tabs_open_on_console_startup = 1

PS: There's also a :NERDTreeTabsOpen command for interactive use.

PPS: Vim "distributions" like spf-13 and Janus lure you with a quick install and out-of-the-box settings, but you pay the price with increased complexity (you need to understand both Vim's runtime loading scheme and the arbitrary conventions of the distribution) and inflexibility (the distribution may make some things easier, but other things very difficult). Vim is incredibly customizable, using someone else's customization makes no sense.

Actually I got the answer:

if you use spf-13 for your vim as the customization.

You should do this:

vim .vimrc.local

Then add this:

let g:nerdtree_tabs_open_on_console_startup = 1
autocmd BufWinEnter * :NERDTreeTabsOpen
autocmd BufWinEnter * :NERDTreeMirrorOpen

and if you want the cursor focus on the content you want to edit, type this:

autocmd VimEnter * wincmd w

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM