Skip to content

Commit b584117

Browse files
committed
runtime(doc): buffers can be re-used
while at it, also move the note about :wincmd directly to :h :wincmd, it doesn't seem to belong to the buffer section. closes: #15636 Signed-off-by: Christian Brabandt <[email protected]>
1 parent 61a6ac4 commit b584117

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

runtime/doc/tags

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6192,6 +6192,7 @@ bufexists() builtin.txt /*bufexists()*
61926192
buffer-functions usr_41.txt /*buffer-functions*
61936193
buffer-hidden windows.txt /*buffer-hidden*
61946194
buffer-list windows.txt /*buffer-list*
6195+
buffer-reuse windows.txt /*buffer-reuse*
61956196
buffer-variable eval.txt /*buffer-variable*
61966197
buffer-write editing.txt /*buffer-write*
61976198
buffer_exists() builtin.txt /*buffer_exists()*

runtime/doc/windows.txt

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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 07
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -67,11 +67,17 @@ active yes yes 'a'
6767
hidden no yes 'h'
6868
inactive 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

7378
The 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*
7682
Each window has a unique identifier called the window ID. This identifier
7783
will 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
8389
window number only applies to the current tab, while the window ID can refer
8490
to 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
==============================================================================
9194
2. Starting Vim *windows-starting*
@@ -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
==============================================================================
489496
5. Moving windows around *window-moving*
490497

0 commit comments

Comments
 (0)