vim - One mapping to toggle NERDTree and open to current file when toggling on -
i'm trying find way have normal mode mapping can toggle nerdtree, when toggling on, tell nerdtree find current file.
i know nerdtreetoggle
, nerdtreefind
, , i'm looking combination of 2 commands.
here's use case:
- when nerdtree not open, can hit
<c-\>
, nerdtree open current file. - i can hit
<c-\>
again , nerdtree close.
it :nerdtreetoggle
command, need, , add %
nnoremap <c-\> :nerdtreetoggle %<cr>
in provided nerd tree can find :nerdtree
command depends on argument given, , in case of :nerdtreetoggle
if no nerd tree exists tab command acts same :nerdtree
command.
Comments
Post a Comment