I'm using the vim plugin NERDTree, and I have the following command in my vimrc file so that nerdtree automatically runs when I open vim:
au VimEnter * NERDTree
However, when I create a new tab, I want NERDTreeMirror to run on the new tab (which, the command above isn't even running on new tabs so adding au VimEnter * NERDTreeMirror is ineffective). Is there something I can set in the vimrc file to run au VimEnter * NERDTreeMirror on new tabs when they're opened?
You may take a look at all the autocmd events using :help event
. There are several interesting events like TabEnter
and BufNew
.
By the way, it's more convenient for me to use F3 to toggle NERDTree in the current tab:
autocmd VimEnter * nmap <F3> :NERDTreeToggle<CR>
autocmd VimEnter * imap <F3> <Esc>:NERDTreeToggle<CR>a
let NERDTreeQuitOnOpen=1
let NERDTreeWinSize=35
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With