I have this line in my .vimrc:
nmap <silent> <Leader>p :NERDTreeToggle<CR>
So what is the hotkey for toggling NERDTree?
How do I remap it to CTRL-D?
what is the difference between nmap
, map
, nnoremap
, inoremap
, etc?
Save the changes, open Vim, and then toggle NERDTree with Ctrl + n .
Ctrl + → arrow will switch to tab that is on the right of current tab.
Press I ( Shift + i ) to toggle hidden files in the NERDTree explorer window. For more detail, access the NERDTree help file :help NERD_tree. txt and search for "hidden". And to hide hidden files by default, put let NERDTreeShowHidden=0 into your vimrc.
to remap in normal mode use
nmap <silent> <C-D> :NERDTreeToggle<CR>
nmap
means map in normal modeimap
means map in insert mode
the nore
part in nnoremap
and its friends prevent expanding the mapping recursively. For example, i use to also hide search string so, in my vimrc I have
nnoremap <silent> <C-L> :noh<CR><C-L>
Without the nore
, the above mapping will loop.
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