Search code examples
vimnerdtree

Is there a way to close all open windows while in NERDTree with one shortcut or function and return back to the command line?


In vim, I might have 3 or 4 files I am viewing at the same time. On such occasions, I will need to close all files individually and return back to the command line so I can do something else.
I'd like to be able to do that quickly and not have to do a :wq in all open windows. Basically a shortcut to close NERDTree and other buffers together.


Solution

  • Use Ctrl + z to go back to command line. Then you can

    fg 1

    to go back to where you were.