how to remove a buffer from gvim without closing the window

淺唱寂寞╮ 提交于 2019-12-03 11:04:36

问题


I usually type :bd to remove the buffer, however, it results in undesirable side-effect of the window being closed which I do NOT want.


回答1:


I usually use :bn (next buffer) followed by :bd# (delete alternate buffer). You could create a mapping or command for this, of course.




回答2:


nmap <leader>d :bprevious<CR>:bdelete #<CR>

Works as it should until one buffer is open in several windows. Good enough unless you want to use the bigger scripts out there.




回答3:


I'm not sure if icecrime's bufclose plugin link is based on the same thing, but the Vim Tips Wiki shows a couple of different approaches via a script. Check them out.




回答4:


Try kwbdi(Keep Window on Buffer Delete) plugin. Worked well for me.



来源:https://stackoverflow.com/questions/4403593/how-to-remove-a-buffer-from-gvim-without-closing-the-window

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!