I have NERDTree plugin installed but it is always present when I start vim like this:
vim .
I only want it to open on demand.
How can I stop it opening whenever I start vim?
Try adding
let g:NERDTreeHijackNetrw=0
to your vimrc and make sure there is no other line that sets this variable.
$ vim .
always opens a file explorer. If you don't have NERDTree or NERDTree is configured as per ZyX's answer you'll get netrw
by default anyway.
I wonder what would happen if the netrw
plugin was somehow removed.
In your vimrc file, do below steps
comment autocmd VimEnter * NERDTree
, which stops opening nerdTree by default
paste map <Cn> :NERDTreeToggle<CR>
in vimrc, this will open NerdTree only when 'Ctrl+n' is pressed from keyboard
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.