Vim: Delete buffer without losing the split window

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

    My Choice is

    :sb # | bd #
    :sb 1 | bd #
    : <1. Recall Buffer> | <2. Delete Buffer>
    

    Think Like that! /// <1. Recall Buffer> | <2. Delete Buffer>

    :vert sb 2 | bd #
    :vert sb  | bd #
    

    why?! It's easy to remember 3 (+ 1) keyword!

    1. sb split_buffer
    2. bd delete buffer ▶ simple 2 keywords
    3. # or Number of buffer
    4. vert ▶ short_form of vertical (split_buffer or else)

    That are easy and very useful in many other many case!

    Have a nice Day! :)

提交回复
热议问题