VIM and NERD Tree - closing a buffer properly

Daniel picture Daniel · Dec 8, 2009 · Viewed 9.1k times · Source

Does anyone know how to close a buffer in VIM when using NERDTree without messing up all your windows? NERD Tree normally breaks up your display into two vertical windows (the browser on your left, and then your main window on the right). If you close a buffer, then you are reduced to one giant file browsing window. If you select another file, then it opens up a second window but separating it horizontally. Any ideas?

Answer

Paweł G. picture Paweł G. · May 12, 2013

Try this mapping: nnoremap <leader>q :bp<cr>:bd #<cr>