Stop NERDTree opening when vim starts

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

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

  2. paste map <C-n> :NERDTreeToggle<CR> in vimrc, this will open NerdTree only when 'Ctrl+n' is pressed from keyboard

Tags:

Vim

Nerdtree