Home Explore Blog CI



neovim

1st chunk of `runtime/doc/windows.txt`
530130747fba7e41177482119d18497521821493086e84580000000100000fa6
*windows.txt*   Nvim


		  VIM REFERENCE MANUAL    by Bram Moolenaar


Editing with multiple windows and buffers.		*windows* *buffers*

The commands which have been added to use multiple windows and buffers are
explained here.  Additionally, there are explanations for commands that work
differently when used in combination with more than one window.

The basics are explained in chapter 7 and 8 of the user manual |usr_07.txt|
|usr_08.txt|.

                                      Type |gO| to see the table of contents.

==============================================================================
1. Introduction					*windows-intro* *window*

Summary:
   A buffer is the in-memory text of a file.
   A window is a viewport on a buffer.
   A tab page is a collection of windows.

A window is a viewport onto a buffer.  You can use multiple windows on one
buffer, or several windows on different buffers.

A buffer is a file loaded into memory for editing.  The original file remains
unchanged until you write the buffer to the file.

A buffer can be in one of three states:

							*active-buffer*
active:   The buffer is displayed in a window.  If there is a file for this
	  buffer, it has been read into the buffer.  The buffer may have been
	  modified since then and thus be different from the file.
							*hidden-buffer*
hidden:   The buffer is not displayed.  If there is a file for this buffer, it
	  has been read into the buffer.  Otherwise it's the same as an active
	  buffer, you just can't see it.
							*inactive-buffer*
inactive: The buffer is not displayed and does not contain anything.  Options
	  for the buffer are remembered if the file was once loaded.  It can
	  contain marks from the |shada| file.  But the buffer doesn't
	  contain text.

In a table:

state		displayed	loaded		":buffers"  ~
		in window			shows	    ~
active		  yes		 yes		  'a'
hidden		  no		 yes		  'h'
inactive	  no		 no		  ' '

							*buffer-reuse*
Each buffer has a unique number and the number will not change within a Vim
session.  The |bufnr()| and |bufname()| functions can be used to convert
between a buffer name and the buffer number.  There is one exception: if a new
empty buffer is created and it is not modified, the buffer will be re-used
when loading another file into that buffer. This also means the buffer number
will not change.

The main Vim window can hold several split windows.  There are also tab pages
|tab-page|, each of which can hold multiple windows.

							*focusable*
If a window is focusable, it is part of the "navigation stack", that is,
editor commands such as :windo, |CTRL-W|, etc., will consider the window as
one that can be made the "current window". A non-focusable window will be
skipped by such commands as it isn't assigned a window number. It can be
explicitly focused by |nvim_set_current_win()|, because it is still
assigned a |window-ID|. If it is focused, it will also have a window number.
Non-focusable windows are not listed by |:tabs|, or counted by 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,

Title: Introduction to Windows, Buffers, and Tabs in Vim
Summary
This section introduces the concepts of windows, buffers, and tab pages in Vim. A buffer is the in-memory representation of a file, a window is a viewport onto a buffer, and a tab page is a collection of windows. Buffers can be active, hidden, or inactive, depending on whether they are displayed and loaded. Each buffer and window has a unique identifier that remains constant during a Vim session. Focusable windows are included in the navigation stack and can be targeted by editor commands. The section also briefly mentions starting Vim with window options.