Home Explore Blog CI



neovim

6th chunk of `runtime/doc/various.txt`
5b060bfd9a9bdc695e084cb1d12acc55246d29801361c6fd0000000100000fa6
      - 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 aborted
			when an error is detected.  |v:errmsg| is still set.
			When [!] is not used, an error message will cause
			further messages to be displayed normally.
			Redirection, started with |:redir|, will continue as
			usual, although there might be small differences.
			This will allow redirecting the output of a command
			without seeing it on the screen.  Example: >
			    :redir >/tmp/foobar
			    :silent g/Aap/p
			    :redir END
<			To execute a Normal mode command silently, use the
			|:normal| command.  For example, to search for a
			string without messages: >
			    :silent exe "normal /path\<CR>"
<			":silent!" is useful to execute a command that may
			fail, but the failure is to be ignored.  Example: >
			    :let v:errmsg = ""
			    :silent! /^begin
			    :if v:errmsg != ""
			    : ... pattern was not found
<			":silent" also skips the hit-enter prompt.
			Dialogs that prompt for user input (|confirm()|,
			'swapfile', …) are never silent.

						*:uns* *:unsilent*
:uns[ilent] {command}	Execute {command} not silently.  Only makes a
			difference when |:silent| was used to get to this
			command.
			Use this for giving a message even when |:silent| was
			used.  In this example |:silent| is used to avoid the
			message about reading the file and |:unsilent| to be
			able to list the first line of each file. >
		:silent argdo unsilent echo expand('%') .. ": " .. getline(1)
<

						*:verb* *:verbose*
:[count]verb[ose] {command}
			Execute {command} with 'verbose' set to [count].  If
			[count] is omitted one is used. ":0verbose" can be
			used to set 'verbose' to zero.
			The additional use of ":silent" makes messages
			generated but not displayed.
			The combination of ":silent" and ":verbose" can be
			used to generate messages and check them with
			|v:statusmsg| and friends.  For example: >
				:let v:statusmsg = ""
				:silent verbose runtime foobar.vim
				:if v:statusmsg != ""
				:  " foobar.vim could not be found
				:endif
<			When concatenating another command, the ":verbose"
			only applies to the first one: >
				:4verbose set verbose | set verbose
<				  verbose=4 ~
				  verbose=0 ~
			For logging verbose messages in a file use the
			'verbosefile' option.

							*:verbose-cmd*
When 'verbose' is non-zero, listing the value of a Vim option or a key map or
an abbreviation or a user-defined function or a command or a highlight group
or an autocommand will also display where it was last defined. If they were
defined in Lua they will only be located if 'verbose' is set. So Start
nvim with -V1 arg to see them. If it was defined manually then there
will be no "Last set" message.  When it was defined while executing a function,
user command or autocommand, the script in which it was defined is reported.

							*K*
[count]K		Runs the program given by 'keywordprg' to lookup the
			|word| (defined by 'iskeyword') under or right of the
			cursor. Default is "man". Works like this: >
				:tabnew | terminal {program} {keyword}

Title: Vim Commands: :silent (continued), :unsilent, :verbose, and Keyword Lookup
Summary
This section continues the explanation of the :silent command, including its interaction with redirection and error handling. It introduces the :unsilent command to override :silent, and the :verbose command to execute a command with a specific verbose level for debugging. Finally, it touches on the 'K' command for keyword lookup using the 'keywordprg' option.