Home Explore Blog CI



neovim

6th chunk of `runtime/doc/windows.txt`
18f04014c1f47d231c35e4b8d00a05a0624e8c7d93261dfe0000000100000fa0
 is not set, [!] is not used, the buffer has
		  changes, and there is no other window on this buffer.
		Changes to the buffer are not written and won't get lost, so
		this is a "safe" command.

CTRL-W CTRL-C						*CTRL-W_CTRL-C*
		You might have expected that CTRL-W CTRL-C closes the current
		window, but that does not work, because the CTRL-C cancels the
		command.

							*:hide*
:hid[e]
:{count}hid[e]
		Without {count}: Quit the current window, unless it is the
		last window on the screen.
		If {count} is given quit the {count} window.

		The buffer becomes hidden (unless there is another window
		editing it or 'bufhidden' is `unload`, `delete` or `wipe`).
		If the window is the last one in the current tab page the tab
		page is closed. |tab-page|

		The value of 'hidden' is irrelevant for this command.
		Changes to the buffer are not written and won't get lost, so
		this is a "safe" command.

:hid[e] {cmd}	Execute {cmd} with 'hidden' set. The previous value of
		'hidden' is restored after {cmd} has been executed.
		Example: >
		    :hide edit Makefile
<		This will edit "Makefile", and hide the current buffer if it
		has any changes.

:on[ly][!]
:{count}on[ly][!]
CTRL-W o						*CTRL-W_o* *E445*
CTRL-W CTRL-O					*CTRL-W_CTRL-O* *:on* *:only*
		Make the current window the only one on the screen. All other
		windows are closed.  For {count} see the `:quit` command
		above |:count_quit|.

		When the 'hidden' option is set, all buffers in closed windows
		become hidden.

		When 'hidden' is not set, and the 'autowrite' option is set,
		modified buffers are written.  Otherwise, windows that have
		buffers that are modified are not removed, unless the [!] is
		given, then they become hidden.  But modified buffers are
		never abandoned, so changes cannot get lost.

							*:fc* *:fclose*
:[count]fc[lose][!]
		Close [count] floating windows with the highest zindex values.
		'!' to close all floating windows.

==============================================================================
4. Moving cursor to other windows			*window-move-cursor*

CTRL-W <Down>					*CTRL-W_<Down>*
CTRL-W CTRL-J					*CTRL-W_CTRL-J* *CTRL-W_j*
CTRL-W j	Move cursor to Nth window below current one.  Uses the cursor
		position to select between alternatives.

CTRL-W <Up>					*CTRL-W_<Up>*
CTRL-W CTRL-K					*CTRL-W_CTRL-K* *CTRL-W_k*
CTRL-W k	Move cursor to Nth window above current one.  Uses the cursor
		position to select between alternatives.

CTRL-W <Left>					*CTRL-W_<Left>*
CTRL-W CTRL-H					*CTRL-W_CTRL-H*
CTRL-W <BS>					*CTRL-W_<BS>* *CTRL-W_h*
CTRL-W h	Move cursor to Nth window left of current one.  Uses the
		cursor position to select between alternatives.

CTRL-W <Right>					*CTRL-W_<Right>*
CTRL-W CTRL-L					*CTRL-W_CTRL-L* *CTRL-W_l*
CTRL-W l	Move cursor to Nth window right of current one.  Uses the
		cursor position to select between alternatives.

CTRL-W w					*CTRL-W_w* *CTRL-W_CTRL-W*
CTRL-W CTRL-W	Without count: move cursor to the |focusable| window
		below/right of the current one.  If none, go to the top-left
		window.  With count: go to Nth window (numbered top-left to
		bottom-right), skipping unfocusable windows.  To obtain the
		window number see |bufwinnr()| and |winnr()|.  When N is
		larger than the number of windows go to the last focusable
		window.

						*CTRL-W_W*
CTRL-W W	Without count: move cursor to the |focusable| window
		above/left of current one.  If none, go to the bottom-right
		window.  With count: go to Nth window, like CTRL-W w.

CTRL-W t					*CTRL-W_t* *CTRL-W_CTRL-T*
CTRL-W CTRL-T	Move cursor to top-left window.

CTRL-W b					*CTRL-W_b* *CTRL-W_CTRL-B*
CTRL-W CTRL-B	Move cursor to bottom-right window.

CTRL-W p					*CTRL-W_p* *CTRL-W_CTRL-P*
CTRL-W CTRL-P	Go to previous (last accessed) window.

						*CTRL-W_P* *E441*
CTRL-W P	Go to preview window.  When there is no preview window this is
		an error.

If Visual mode is active and the new window is not for the same buffer, the
Visual mode is ended.  If the window

Title: More Window Commands: Hide, Only, and Cursor Movement
Summary
This section continues detailing window management commands. It describes `:hide` (quit the current or specified window, hiding the buffer), and `:only` (close all other windows, making the current window the only one, with consideration for 'hidden' and 'autowrite' options). It also covers closing floating windows using `:fclose`. The section then shifts to commands for moving the cursor between windows using `CTRL-W` followed by arrow keys or letters, allowing movement up, down, left, right, to the top-left, bottom-right, previous, or preview window.