Home Explore Blog CI



neovim

11th chunk of `runtime/doc/windows.txt`
452f7a218ef47a65dd33a3ff96b74057cd91e851c27cf5130000000100000fa2


------------------------------------------------------------------------------
The argument list and multiple windows

The current position in the argument list can be different for each window.
Remember that when doing ":e file", the position in the argument list stays
the same, but you are not editing the file at that position.  To indicate
this, the file message (and the title, if you have one) shows
"(file (N) of M)", where "(N)" is the current position in the file list, and
"M" the number of files in the file list.

All the entries in the argument list are added to the buffer list.  Thus, you
can also get to them with the buffer list commands, like ":bnext".

:[N]al[l][!] [N]				*:al* *:all* *:sal* *:sall*
:[N]sal[l][!] [N]
		Rearrange the screen to open one window for each argument.
		All other windows are closed.  When a count is given, this is
		the maximum number of windows to open.
		With the |:tab| modifier open a tab page for each argument.
		When there are more arguments than 'tabpagemax' further ones
		become split windows in the last tab page.
		When the 'hidden' option is set, all buffers in closed windows
		become hidden.
		When 'hidden' is not set, and the 'autowrite' option is set,
		modified buffers are written.  Otherwise, windows that have
		buffers that are modified are not removed, unless the [!] is
		given, then they become hidden.  But modified buffers are
		never abandoned, so changes cannot get lost.
		[N] is the maximum number of windows to open.  'winheight'
		also limits the number of windows opened ('winwidth' if
		|:vertical| was prepended).
		Buf/Win Enter/Leave autocommands are not executed for the new
		windows here, that's only done when they are really entered.
		If autocommands change the window layout while this command is
		busy an error will be given. *E249*

:[N]sa[rgument][!] [++opt] [+cmd] [N]			*:sa* *:sargument*
		Short for ":split | argument [N]": split window and go to Nth
		argument.  But when there is no such argument, the window is
		not split.  Also see |++opt| and |+cmd|.

:[N]sn[ext][!] [++opt] [+cmd] [file ..]			*:sn* *:snext*
		Short for ":split | [N]next": split window and go to Nth next
		argument.  But when there is no next file, the window is not
		split.  Also see |++opt| and |+cmd|.

:[N]spr[evious][!] [++opt] [+cmd] [N]			*:spr* *:sprevious*
:[N]sN[ext][!] [++opt] [+cmd] [N]			*:sN* *:sNext*
		Short for ":split | [N]Next": split window and go to Nth
		previous argument.  But when there is no previous file, the
		window is not split.  Also see |++opt| and |+cmd|.

						*:sre* *:srewind*
:sre[wind][!] [++opt] [+cmd]
		Short for ":split | rewind": split window and go to first
		argument.  But when there is no argument list, the window is
		not split.  Also see |++opt| and |+cmd|.

						*:sfir* *:sfirst*
:sfir[st] [++opt] [+cmd]
		Same as ":srewind".

						*:sla* *:slast*
:sla[st][!] [++opt] [+cmd]
		Short for ":split | last": split window and go to last
		argument.  But when there is no argument list, the window is
		not split.  Also see |++opt| and |+cmd|.

						*:dr* *:drop*
:dr[op] [++opt] [+cmd] {file} ..
		Edit the first {file} in a window.
		- If the file is already open in a window change to that
		  window.
		- If the file is not open in a window edit the file in the
		  current window.  If the current buffer can't be |abandon|ed,
		  the window is split first.
		- Windows that are not in the argument list or are not full
		  width will be closed if possible.
		The |argument-list| is set, like with the |:next| command.
		The purpose of this command is that it can be used from a
		program that wants Vim to edit another file, e.g., a debugger.
		When using the |:tab| modifier each argument is opened in a
		tab page.  The last window is used if it's empty.
		Also see |++opt| and |+cmd|.

==============================================================================
8. Do a command in all buffers or windows			*list-repeat*

							*:windo*
:[range]windo {cmd}

Title: Argument List Commands and Window Management
Summary
This section elaborates on argument list commands and their effects on window management. It details the behavior of commands like ':all', ':sargument', ':snext', ':sprevious', ':srewind', ':slast', and ':drop', including how they interact with split windows, tab pages, and the 'hidden' and 'autowrite' options. It also introduces the ':windo' command for executing commands in all windows.