Vim 关闭窗口而不关闭缓冲区 [英] Vim close window without closing buffer

查看:38
本文介绍了Vim 关闭窗口而不关闭缓冲区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不删除缓冲区的情况下关闭窗口或取消拆分?

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

推荐答案

如果你想在窗口中编辑另一个缓冲区,只需使用 :edit/:buf.当前缓冲区将被替换,并保留在缓冲区列表中(即它显示在 :ls 中).

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).

如果要关闭窗口拆分,请使用:close.:quit 命令也可以使用,但是当这是最后一个窗口时有关闭 Vim 的副作用.

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

如果您知道 Vim 如何处理缓冲区,这是许多用户都设置的推荐选项.

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

这篇关于Vim 关闭窗口而不关闭缓冲区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆