the default
'tabline'. Their buffer content is not included in 'complete' "w" completion.
Windows (especially floating windows) can have many other |api-win_config|
properties such as "hide" and "fixed" which also affect behavior.
*window-ID* *winid* *windowid*
Each window has a unique identifier called the window ID. This identifier
will not change within a Vim session. The |win_getid()| and |win_id2tabwin()|
functions can be used to convert between the window/tab number and the
identifier. There is also the window number, which may change whenever
windows are opened or closed, see |winnr()|.
The window number is only valid in one specific tab. The window ID is valid
across tabs. For most functions that take a window ID or a window number, the
window number only applies to the current tab, while the window ID can refer
to a window in any tab.
==============================================================================
2. Starting Vim *windows-starting*
By default, Vim starts with one window, just like Vi.
The "-o" and "-O" arguments to Vim can be used to open a window for each file
in the argument list. The "-o" argument will split the windows horizontally;
the "-O" argument will split the windows vertically. If both "-o" and "-O"
are given, the last one encountered will be used to determine the split
orientation. For example, this will open three windows, split horizontally: >
vim -o file1 file2 file3
"-oN", where N is a decimal number, opens N windows split horizontally. If
there are more file names than windows, only N windows are opened and some
files do not get a window. If there are more windows than file names, the
last few windows will be editing empty buffers. Similarly, "-ON" opens N
windows split vertically, with the same restrictions.
If there are many file names, the windows will become very small. You might
want to set the 'winheight' and/or 'winwidth' options to create a workable
situation.
Buf/Win Enter/Leave |autocommand|s are not executed when opening the new
windows and reading the files, that's only done when they are really entered.
*status-line*
A status line will be used to separate windows. The 'laststatus' option tells
when the last window also has a status line:
'laststatus' = 0 never a status line
'laststatus' = 1 status line if there is more than one window
'laststatus' = 2 always a status line
'laststatus' = 3 have a global statusline at the bottom instead
of one for each window
You can change the contents of the status line with the 'statusline' option.
This option can be local to the window, so that you can have a different
status line in each window.
Normally, inversion is used to display the status line. This can be changed
with the |hl-StatusLine| highlight group. If no highlighting is used for the
status line, the '^' character is used for the current window, and '=' for
other windows. If 'mouse' is enabled, a status line can be dragged to resize
windows.
*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