How can I close a buffer without closing the window?

前端 未结 16 1021
鱼传尺愫
鱼传尺愫 2020-12-12 13:35

Vim\'s multilayered views (Windows, Buffers and Tabs) left me a little confused. Let\'s say I split the display (:sp) and then select a different buffer to display in each w

16条回答
  •  情深已故
    2020-12-12 13:48

    A simple version I use personally is

    :bp|bd#
    

    It goes to the previous buffer and deletes the other buffer (which is actually the original where we jumped from). This does what you would expect in 99% of cases without any complicated scripts.

    As a keyboard shortcut I use the following

    nnoremap  c :bpbd#
    

提交回复
热议问题