我把窗户横着分开了。现在我如何回到正常模式,即没有分裂窗口,只有一个窗口,而不取消所有打开的窗口。我有5个,并不想“退出”,只是想从分裂的窗口出去。


当前回答

提供窗口号以关闭特定窗口而不保留当前窗口:

:[N]close
:close[N]
:[N]quit
:quit[N]
Ctrl-W[N]c

窗口号可以通过以下设置显示在状态行中:

:set statusline+=%{tabpagewinnr(tabpagenr())}

其他回答

就像之前说的那样,这样做的方法是按ctrl+w然后o。这将“最大化”当前窗口,同时关闭其他窗口。如果你想“不最大化”它,有一个插件叫ZoomWin。否则,您必须从头重新创建窗口设置。

好的,我只是分离并重新连接到屏幕会话,我回到了我想要的正常屏幕

我发现按ctrl + w到你想关闭的窗口,然后只需做:q。这对我很有用。

命令:hide将隐藏当前聚焦的窗口。我认为这就是你想要的功能。

为了在窗口之间导航,键入Ctrl+w后跟一个导航键(h,j,k,l或方向键)

有关更多信息,请运行:help window和:help hide in vim。

help open -window(搜索" close a window" - / close a window)

:q[uit] close the current window and buffer. If it is the last window it will also exit vim :bd[elete] unload the current buffer and close the current window :qa[all] or :quita[ll] will close all buffers and windows and exit vim (:qa! to force without saving changes) :clo[se] close the current window but keep the buffer open. If there is only one window this command fails :hid[e] hide the buffer in the current window (Read more at :help hidden) :on[ly] close all other windows but leave all buffers open