Home Explore Blog CI



neovim

7th chunk of `runtime/doc/windows.txt`
7f1566d6b0f6479c858e468107e1e9f141859ffff72fd5b80000000100000fa4
	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 is on the same buffer, the cursor
position is set to keep the same Visual area selected.

						*:winc* *:wincmd*
These commands can also be executed with ":wincmd":

:[count]winc[md] {arg}
:winc[md] [count] {arg}
		Like executing CTRL-W [count] {arg}.  Example: >
			:wincmd j
<		Moves to the window below the current one.
		This command is useful when a Normal mode cannot be used (for
		the |CursorHold| autocommand event).  Or when a Normal mode
		command is inconvenient.
		The count can also be a window number.  Example: >
			:exe nr .. "wincmd w"
<		This goes to window "nr".

Note: All CTRL-W commands can also be executed with |:wincmd|, for those
places where a Normal mode command can't be used or is inconvenient (e.g.
in a browser-based terminal).

==============================================================================
5. Moving windows around				*window-moving*

CTRL-W r				*CTRL-W_r* *CTRL-W_CTRL-R* *E443*
CTRL-W CTRL-R	Rotate windows downwards/rightwards.  The first window becomes
		the second one, the second one becomes the third one, etc.
		The last window becomes the first window.  The cursor remains
		in the same window.
		This only works within the row or column of windows that the
		current window is in.

						*CTRL-W_R*
CTRL-W R	Rotate windows upwards/leftwards.  The second window becomes
		the first one, the third one becomes the second one, etc.  The
		first window becomes the last window.  The cursor remains in
		the same window.
		This only works within the row or column of windows that the
		current window is in.

CTRL-W x					*CTRL-W_x* *CTRL-W_CTRL-X*
CTRL-W CTRL-X	Without count: Exchange current window with next one.  If there
		is no next window, exchange with previous window.
		With count: Exchange current window with Nth window (first
		window is 1).  The cursor is put in the other window.
		When vertical and horizontal window splits are mixed, the
		exchange is only done in the row or column of windows that the
		current window is in.

The following commands can be used to change the window layout.  For example,
when there are two vertically split windows, CTRL-W K will change that in
horizontally split windows.  CTRL-W H does it the other way around.

						*CTRL-W_K*
CTRL-W K	Move the current window to be at the very top, using the full
		width of the screen.  This works like `:topleft split`, except
		it is applied to the current window and no new window is
		created.

						*CTRL-W_J*
CTRL-W J	Move the current window to be at the very bottom, using the
		full width of the screen.  This works like `:botright split`,
		except it is applied to the current window and no new window
		is created.

						*CTRL-W_H*
CTRL-W H	Move the current window to be at the far left, using the
		full height of the screen.  This works like
		`:vert topleft split`, except it is applied to the current
		window and no new window is created.

						*CTRL-W_L*
CTRL-W L	Move the current window to be at the far right, using the full

Title: Window Navigation and Manipulation: wincmd and Moving Windows
Summary
This section details window navigation commands (using CTRL-W followed by another key) to move the cursor to different windows and move them around. `CTRL-W w` moves the cursor to the next focusable window (right/down), while `CTRL-W W` moves it to the previous (left/up). Specific commands exist to jump to the top-left (`CTRL-W t`), bottom-right (`CTRL-W b`), previous (`CTRL-W p`), or preview (`CTRL-W P`) window. It introduces the `:wincmd` command as an alternative for executing `CTRL-W` commands. The section covers window rearrangement commands: `CTRL-W r` and `CTRL-W R` rotate windows, while `CTRL-W x` exchanges the current window with another. Finally, it explains commands to move the current window to the top (`CTRL-W K`), bottom (`CTRL-W J`), left (`CTRL-W H`), or right (`CTRL-W L`) edge of the screen.