Home Explore Blog CI



neovim

4th chunk of `runtime/doc/windows.txt`
44cf86238d856479681358525db38c360455110c2544aac20000000100000fe2
	*:split_f*
		Create a new window and start editing file {file} in it.  This
		behaves almost like a ":split" first, and then an ":edit"
		command, but the alternate file name in the original window is
		set to {file}.
		If [+cmd] is given, execute the command when the file has been
		loaded |+cmd|.
		Also see |++opt|.
		Make new window N high (default is to use half the existing
		height).  Reduces the current window height to create room
		(and others, if the 'equalalways' option is set).

:[N]vne[w] [++opt] [+cmd] [file]			*:vne* *:vnew*
		Like |:new|, but split vertically.  If 'equalalways' is set
		and 'eadirection' isn't "ver" the windows will be spread out
		horizontally, unless a width was specified.

:[N]sv[iew] [++opt] [+cmd] [file]		*:sv* *:sview* *splitview*
		Same as ":split", but set 'readonly' option for this buffer.

:[N]sf[ind] [++opt] [+cmd] {file}	     *:sf* *:sfi* *:sfind* *splitfind*
		Same as ":split", but search for {file} in 'path' like in
		|:find|.  Doesn't split if {file} is not found.

CTRL-W CTRL-^					*CTRL-W_CTRL-^* *CTRL-W_^*
CTRL-W ^	Split the current window in two and edit the alternate file.
		When a count N is given, split the current window and edit
		buffer N.  Similar to ":sp #" and ":sp #N", but it allows the
		other buffer to be unnamed.  This command matches the behavior
		of |CTRL-^|, except that it splits a window first.

CTRL-W ge						*CTRL-W_ge*
		Detach the current window as an external window.
		Only available when using a UI with |ui-multigrid| support.

Note that the 'splitbelow' and 'splitright' options influence where a new
window will appear.
								*E36*
Creating a window will fail if there is not enough room.  Every window needs
at least one screen line and column, sometimes more.   Options 'winminheight'
and 'winminwidth' are relevant.

						*:vert* *:vertical*
:vert[ical] {cmd}
		Execute {cmd}.  If it contains a command that splits a window,
		it will be split vertically.  For `vertical wincmd =` windows
		will be equalized only vertically.
		Doesn't work for |:execute| and |:normal|.

						*:hor* *:horizontal*
:hor[izontal] {cmd}
		Execute {cmd}.  Currently only makes a difference for
		the following commands:
		- `:wincmd =`: equalize windows only horizontally.
		- |:terminal|: open a |terminal| buffer in a split window.
		- |:checkhealth|: open a healthcheck buffer in a split window.

:lefta[bove] {cmd}				*:lefta* *:leftabove*
:abo[veleft] {cmd}				*:abo* *:aboveleft*
		Execute {cmd}.  If it contains a command that splits a window,
		it will be opened left (vertical split) or above (horizontal
		split) the current window.  Overrules 'splitbelow' and
		'splitright'.
		Doesn't work for |:execute| and |:normal|.

:rightb[elow] {cmd}				*:rightb* *:rightbelow*
:bel[owright] {cmd}				*:bel* *:belowright*
		Execute {cmd}.  If it contains a command that splits a window,
		it will be opened right (vertical split) or below (horizontal
		split) the current window.  Overrules 'splitbelow' and
		'splitright'.
		Doesn't work for |:execute| and |:normal|.

						*:topleft* *E442*
:to[pleft] {cmd}
		Execute {cmd}.  If it contains a command that splits a window,
		it will appear at the top and occupy the full width of the Vim
		window.  When the split is vertical the window appears at the
		far left and occupies the full height of the Vim window.
		Doesn't work for |:execute| and |:normal|.

						*:bo* *:botright*
:bo[tright] {cmd}
		Execute {cmd}.  If it contains a command that splits a window,
		it will appear at the bottom and occupy the full width of the
		Vim window.  When the split is vertical the window appears at
		the far right and occupies the full height of the Vim window.
		Doesn't work for |:execute| and |:normal|.

These command modifiers can be combined to make a vertically split window
occupy the full height.  Example: >
	:vertical topleft split tags
Opens a vertically split, full-height window on the "tags" file at the far
left of the Vim window.


------------------------------------------------------------------------------

Title: More Window Splitting Commands, Modifiers, and Detaching
Summary
This section details more window splitting commands, including :vnew (vertical new window), :sview (split with readonly), :sfind (split and find file in path), and CTRL-W ^ (split and edit alternate file). It also covers detaching a window as an external window (CTRL-W ge). The section explains the influence of 'splitbelow' and 'splitright' options on new window placement. It introduces command modifiers like :vertical, :horizontal, :leftabove, :rightbelow, :topleft, and :botright to control window split direction and placement within the Vim window. These modifiers are useful for precisely positioning new windows during splits.