I read that if you write out nnoremap <C-e> :NERDTreeToggle<CR>
, you can toggle NERDTree viewer - if you don't start NERDTree yet and type in Control+E
, then you can open the NERDTree viewer, and if you already opened it, you can close the NERDTree in the same way as you type in :NERDTreeToggle
.
However, when I try to do the same, I can successfully open it - but I cannot close it and the screen remains the same except the main title slightly changes, such as from NERD_tree_1
to NERD_tree_2
.
So how can I use the toggle functionality? Or do I get it wrong?
I have noticed you are using inoremap
which binds a C-e in Insert Mode only.
I have tried your way on my VIM installation, and indeed it will type :NERDTreeToggle
in insert mode on pressing C-e.
While in normal mode there is no effect.
If it is a mistake, try changing to:
nnoremap <C-e> :NERDTreeToggle<CR>
I added it in .vimrc
- it works fine.
Also, if you still run into a problem, give another hotkey a try, you might be clashing with other binds.
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