2

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.

1

3 Answers 3

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)

3
  • 1
    :q in the NERDTree window also works. :) A tip is to bind :NERDTreeToggle Ctrl+n to toggle NERDTree nnoremap <C-n> :NERDTreeToggle<CR> Commented Nov 18, 2022 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
    Commented Nov 18, 2022 at 14:59
  • 2
    OP is not asking how to close the NerdTree window.
    – romainl
    Commented Nov 21, 2022 at 12:38
1

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

2
  • 2
    OP is not asking how to close the NerdTree window.
    – romainl
    Commented Nov 21, 2022 at 12:38
  • Oh my bad Ctrl-c closes the NERDTreeMenu Commented Nov 21, 2022 at 14:21
0

I believe pressing Esc or Ctrl-c works.

1
  • If you verified it works, you should edit and rephrase your answer to be a bit more assertive. If you haven't verified it, you should do so.
    – Friedrich
    Commented Jun 14 at 11:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.