Vim close window without closing buffer

后端 未结 3 2031
遥遥无期
遥遥无期 2021-01-30 13:43

How do I close a window or unsplit without deleting the buffer?

3条回答
  •  我在风中等你
    2021-01-30 14:17

    If you want to edit another buffer in the window, just use :edit / :buf. The current buffer will be replaced, and remains in the buffer list (i.e. it shows up in :ls).

    If you want to close the windows split, use :close. The :quit command will work, too, but has the side effect of closing Vim when this is the last window.

    In order to leave buffers that have changes, you need

    :set hidden
    

    If you know how Vim deals with buffers, this is a recommended option that many users have set.

提交回复
热议问题