Vim: Delete buffer without losing the split window

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

    bp|bd # will do it.


    Details:bp("buffer previous") moves us to a different buffer in the current window (bn would work, too), then bd # ("buffer delete" "alternate file") deletes the buffer we just moved away from. See: help bp, help bd, help alternate-file.

提交回复
热议问题