Vim: Delete buffer without losing the split window

前端 未结 8 864
后悔当初
后悔当初 2020-12-07 07:55

When a buffer gets deleted (the \"bd[elete]\" command), it not only deletes the buffer but also removes the split window that buffer was in.

Is there a way to delete

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-07 08:40

    I do something similar to @Mud, but switch to previous view buffer, #, instead of the previous buffer in buffer list. Here is a binding key in my .vimrc:

    nnoremap  q :lcloseb#bd #
    

    Close Location windows, if exist, switch to the previous view buffer, and then close the last switched buffer.

提交回复
热议问题