Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

question from:https://stackoverflow.com/questions/22087724/vim-close-window-without-closing-buffer

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
321 views
Welcome To Ask or Share your Answers For Others

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...