Vim: Delete buffer without losing the split window

前端 未结 8 868
后悔当初
后悔当初 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:41

    I used to use :

    :bpspbnbd
    

    But I found certain occasions where it closed my window. On top of that the next or previous buffer might not be what you want to be displayed in the split.

    Now I do this :

    • switch to the buffer I want to work on
    • Delete the alternate buffer

    nnoremap d :bd#

提交回复
热议问题