Stop opening NERDTree when starting vim

I have the NERDTree plugin installed, but it is always present when I run vim as follows:

vim.

I just want it to open on demand.

How can I stop it opening when I start vim?

+9
vim nerdtree
source share
3 answers

Try to add

let g:NERDTreeHijackNetrw=0 

to your vimrc and make sure there is no other line that sets this variable.

+11
source share

$ vim . always opens a file explorer. If you don't have NERDTree or NERDTree is configured according to ZyX's answer, you will still get netrw by default.

I wonder what would happen if the netrw plugin was somehow removed.

+5
source share

In your vimrc file follow these steps

  1. autocmd VimEnter * NERDTree comment autocmd VimEnter * NERDTree , which by default stops opening nerdTree

  2. insert map <Cn> :NERDTreeToggle<CR> in vimrc, this will open NerdTree only when you press Ctrl + n on the keyboard

0
source share

All Articles