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?
Try to add
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 according to ZyX's answer, you will still get netrw by default.
$ vim .
netrw
I wonder what would happen if the netrw plugin was somehow removed.
In your vimrc file follow these steps
autocmd VimEnter * NERDTree comment autocmd VimEnter * NERDTree , which by default stops opening nerdTree
autocmd VimEnter * NERDTree
insert map <Cn> :NERDTreeToggle<CR> in vimrc, this will open NerdTree only when you press Ctrl + n on the keyboard
map <Cn> :NERDTreeToggle<CR>