Vim: Close a buffer without losing split/window
So you set up 3 split windows and now do you want to close one of them without losing the positioning. The problem is that :bw
actually deletes the windows related to the buffer, as doc says: "Any windows for this buffer are closed"
Solution:
:ene | bw #
Or put the line below in your .vimrc:
nmap <leader>c :ene<CR>:bw #<CR>
And type \c
Written by Caio Ariede
Related protips
2 Responses
What about :hide ?
[ You can use ":hide" to close a window without unloading the
buffer. ]
over 1 year ago
·
It's the reverse case. Keep the window but close the buffer.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Related Tags
#vim
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#