Home Explore Blog CI



neovim

5th chunk of `runtime/doc/various.txt`
f1243925b431276d0af01461fe7cc187704edc49ea43b6550000000100000fa1
	":redir" will close any active redirection before
			starting redirection to the new target.  For recursive
			use check out |execute()|.

			To stop the messages and commands from being echoed to
			the screen, put the commands in a function and call it
			with ":silent call Function()".
			Alternatives are the 'verbosefile' option or
			|execute()| function, these can be used in combination
			with ":redir".

:redi[r] >> {file}	Redirect messages to file {file}.  Append if {file}
			already exists.

:redi[r] @{a-zA-Z}
:redi[r] @{a-zA-Z}>	Redirect messages to register {a-z}.  Append to the
			contents of the register if its name is given
			uppercase {A-Z}.  The ">" after the register name is
			optional.
:redi[r] @{a-z}>>	Append messages to register {a-z}.

:redi[r] @*>
:redi[r] @+>		Redirect messages to the selection or clipboard. For
			backward compatibility, the ">" after the register
			name can be omitted. See |quotestar| and |quoteplus|.
:redi[r] @*>>
:redi[r] @+>>		Append messages to the selection or clipboard.

:redi[r] @">		Redirect messages to the unnamed register. For
			backward compatibility, the ">" after the register
			name can be omitted.
:redi[r] @">>		Append messages to the unnamed register.

:redi[r] => {var}	Redirect messages to a variable.  If the variable
			doesn't exist, then it is created.  If the variable
			exists, then it is initialized to an empty string.
			The variable will remain empty until redirection ends.
			Only string variables can be used.  After the
			redirection starts, if the variable is removed or
			locked or the variable type is changed, then further
			command output messages will cause errors.  When using
			a local variable (l:var in a function or s:var in a
			script) and another `:redir` causes the current one to
			end, the scope might be different and the assignment
			fails.
			To get the output of one command the |execute()|
			function can be used instead of redirection.

:redi[r] =>> {var}	Append messages to an existing variable.  Only string
			variables can be used.

:redi[r] END		End redirecting messages.

							*:filt* *:filter*
:filt[er][!] {pattern} {command}
:filt[er][!] /{pattern}/ {command}
			Restrict the output of {command} to lines matching
			with {pattern}.  For example, to list only xml files: >
				:filter /\.xml$/ oldfiles
<			If the [!] is given, restrict the output of {command}
			to lines that do NOT match {pattern}.

			{pattern} is a Vim search pattern.  Instead of enclosing
			it in / any non-ID character (see |'isident'|) can be
			used, so long as it does not appear in {pattern}.
			Without the enclosing character the pattern cannot
			include the bar character. 'ignorecase' is not used.

			The pattern is matched against the relevant part of
			the output, not necessarily the whole line. Only some
			commands support filtering, try it out to check if it
			works. Some of the commands that support filtering:
			   |:#|          - filter whole line
			   |:clist|      - filter by file name or module name
			   |:command|    - filter by command name
			   |:files|      - filter by file name
			   |:highlight|  - filter by highlight group
			   |:history|    - filter by history commands
			   |:jumps|      - filter by file name
			   |:let|        - filter by variable name
			   |:list|       - filter whole line
			   |:llist|      - filter by file name or module name
			   |:marks|      - filter by text in the current file,
					   or file name for other files
			   |:oldfiles|   - filter by file name
			   |:registers|  - filter by register contents
					   (does not work multi-line)
			   |:set|        - filter by option name

			Only normal messages are filtered, error messages are
			not.

						*:sil* *:silent* *:silent!*
:sil[ent][!] {command}	Execute {command} silently.  Normal messages will not
			be given or added to the message history.
			When [!] is added, error messages will also be
			skipped, and commands and mappings will not be

Title: Vim Commands: :redir (continued), :filter, and :silent
Summary
This section details the :redir command, explaining how it redirects messages to files, registers, or variables. It also covers the :filter command to restrict output of commands based on a pattern, and the :silent command to execute commands without displaying normal or error messages.