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:

  1. when nerdtree not open, can hit <c-\> , nerdtree open current file.
  2. 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

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -