how to remove a buffer from gvim without closing the window

前端 未结 4 684
情歌与酒
情歌与酒 2021-02-05 05:54

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.

相关标签:
4条回答
  • 2021-02-05 06:30

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

    0 讨论(0)
  • 2021-02-05 06:31

    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.

    0 讨论(0)
  • 2021-02-05 06:35
    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.

    0 讨论(0)
  • 2021-02-05 06:49

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

    0 讨论(0)
提交回复
热议问题