1

I use Vim plugin NerdTree. If I have to quickly add a file, the NerdTreeMenu I get by pressing m is very helful.

How I can close my NerdTreeMenu? I'm unable to find information in any documentation on closing the NerdTree menu.

Vivian De Smedt
  • 16,336
  • 3
  • 18
  • 37

2 Answers2

2

It is either :NERDTreeClose to close it, or :NERDTreeToggle to toggle it on and off :)

Edit: @Gustav Blomqvist reminded me, that you can also use the classic vim exit commands while the NERDTree window is in focus:

  • :q

  • ZZ 2x(Shift + z)

  • ^Wq (Ctrl-w + q)

D. Ben Knoble
  • 26,070
  • 3
  • 29
  • 65
Bog
  • 469
  • 1
  • 14
  • 1
    :q in the NERDTree window also works. :)

    A tip is to bind :NERDTreeToggle Ctrl+n to toggle NERDTree nnoremap <C-n> :NERDTreeToggle<CR>

    – Gustav Blomqvist Nov 18 '22 at 10:42
  • Yeah right you could also do it that way. You can also use the classic vim exit commands (:q / ZZ / ^Wq) I will write that to my answer, thanks :)) – Bog Nov 18 '22 at 14:59
  • 2
    OP is not asking how to close the NerdTree window. – romainl Nov 21 '22 at 12:38
0

If the NERDTree window is in focus then just a simple q will work.

Gustav Blomqvist
  • 791
  • 1
  • 6
  • 18