1- *windows.txt* For Vim version 9.1. Last change: 2024 Jul 09
1+ *windows.txt* For Vim version 9.1. Last change: 2024 Sep 08
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -67,11 +67,17 @@ active yes yes 'a'
6767hidden no yes 'h'
6868inactive no no ' '
6969
70- Note: All CTRL-W commands can also be executed with | :wincmd | , for those
71- places where a Normal mode command can't be used or is inconvenient.
70+ *buffer-reuse*
71+ Each buffer has a unique number and the number will not change within a Vim
72+ session. The | bufnr() | and | bufname() | functions can be used to convert
73+ between a buffer name and the buffer number. There is one exception: if a new
74+ empty buffer is created and it is not modified, the buffer will be re-used
75+ when loading another file into that buffer. This also means the buffer number
76+ will not change.
7277
7378The main Vim window can hold several split windows. There are also tab pages
7479| tab-page | , each of which can hold multiple windows.
80+
7581 *window-ID* *winid* *windowid*
7682Each window has a unique identifier called the window ID. This identifier
7783will not change within a Vim session. The | win_getid() | and | win_id2tabwin() |
@@ -83,9 +89,6 @@ across tabs. For most functions that take a window ID or a window number, the
8389window number only applies to the current tab, while the window ID can refer
8490to a window in any tab.
8591
86- Each buffer has a unique number and the number will not change within a Vim
87- session. The | bufnr() | and | bufname() | functions can be used to convert
88- between a buffer name and the buffer number.
8992
9093==============================================================================
91942. Starting Vim *windows-starting*
@@ -391,7 +394,7 @@ CTRL-W CTRL-C *CTRL-W_CTRL-C*
391394 to the buffer are not written and won't get lost, so this is a
392395 "safe" command.
393396
394- :hid[e] {cmd} Execute {cmd} with 'hidden' is set. The previous value of
397+ :hid[e] {cmd} Execute {cmd} with 'hidden' set. The previous value of
395398 'hidden' is restored after {cmd} has been executed.
396399 Example: >
397400 :hide edit Makefile
@@ -485,6 +488,10 @@ These commands can also be executed with ":wincmd":
485488 :exe nr .. "wincmd w"
486489< This goes to window "nr".
487490
491+ Note: All CTRL-W commands can also be executed with | :wincmd | , for those
492+ places where a Normal mode command can't be used or is inconvenient (e.g.
493+ in a browser-based terminal).
494+
488495==============================================================================
4894965. Moving windows around *window-moving*
490497
0 commit comments