Home Explore Blog CI



neovim

3rd chunk of `runtime/doc/windows.txt`
57e0d5053b240874ea2fc2012419a24e503e7cbd63f084300000000100000fa4

							*filler-lines*
The lines after the last buffer line in a window are called filler lines.  By
default, these lines start with a tilde (~) character. The "eob" item in the
'fillchars' option can be used to change this character. By default, these
characters are highlighted as NonText (|hl-NonText|). The EndOfBuffer
highlight group (|hl-EndOfBuffer|) can be used to change the highlighting of
the filler characters.

==============================================================================
3. Opening and closing a window				*opening-window*

CTRL-W s						*CTRL-W_s*
CTRL-W S						*CTRL-W_S*
CTRL-W CTRL-S						*CTRL-W_CTRL-S*
:[N]sp[lit] [++opt] [+cmd] [file]			*:sp* *:split*
		Split current window in two.  The result is two viewports on
		the same file.

		Make the new window N high (default is to use half the height
		of the current window).  Reduces the current window height to
		create room (and others, if the 'equalalways' option is set,
		'eadirection' isn't "hor", and one of them is higher than the
		current or the new window).

		If [file] is given it will be edited in the new window.  If it
		is not loaded in any buffer, it will be read.  Else the new
		window will use the already loaded buffer.

		Note: CTRL-S does not work on all terminals and might block
		further input, use CTRL-Q to get going again.
		Also see |++opt| and |+cmd|.
							*E242* *E1159*
		Be careful when splitting a window in an autocommand, it may
		mess up the window layout if this happens while making other
		window layout changes.

CTRL-W CTRL-V						*CTRL-W_CTRL-V*
CTRL-W v						*CTRL-W_v*
:[N]vs[plit] [++opt] [+cmd] [file]			*:vs* *:vsplit*
		Like |:split|, but split vertically.  The windows will be
		spread out horizontally if
		1. a width was not specified,
		2. 'equalalways' is set,
		3. 'eadirection' isn't "ver", and
		4. one of the other windows is wider than the current or new
		   window.
		If N was given make the new window N columns wide, if
		possible.
		Note: In other places CTRL-Q does the same as CTRL-V, but here
		it doesn't!

CTRL-W n						*CTRL-W_n*
CTRL-W CTRL-N						*CTRL-W_CTRL-N*
:[N]new [++opt] [+cmd]					*:new*
		Create a new window and start editing an empty file in it.
		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 and 'eadirection'
		isn't "hor").
		Also see |++opt| and |+cmd|.
		If 'fileformats' is not empty, the first format given will be
		used for the new buffer.  If 'fileformats' is empty, the
		'fileformat' of the current buffer is used.  This can be
		overridden with the |++opt| argument.
		Autocommands are executed in this order:
		1. WinLeave for the current window
		2. WinEnter for the new window
		3. BufLeave for the current buffer
		4. BufEnter for the new buffer
		This behaves like a ":split" first, and then an ":enew"
		command.

:[N]new [++opt] [+cmd] {file}
:[N]sp[lit] [++opt] [+cmd] {file}			*: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

Title: Opening and Closing Windows in Vim: Splitting, New Windows, and More
Summary
This section details various commands for opening and closing windows in Vim. It covers commands for splitting windows horizontally (:split, CTRL-W s) and vertically (:vsplit, CTRL-W v), creating new empty windows (:new, CTRL-W n), and opening files in new windows (:new {file}, :split {file}). Also covered are variations for read-only splits (:sview) and splits that search for files in the 'path' (:sfind). The section highlights options for controlling window size, behavior with 'equalalways', and potential issues when splitting windows in autocommands.