Home Explore Blog CI



neovim

7th chunk of `runtime/doc/vvars.txt`
7ad60da8373ebc6c0c10ff788e901e0250780d4f195aa7160000000100000fa2

v:option_oldlocal
		Old local value of the option. Valid while executing an
		|OptionSet| autocommand.

				*v:option_type* *option_type-variable*
v:option_type
		Scope of the set command. Valid while executing an
		|OptionSet| autocommand. Can be either "global" or "local"

				*v:prevcount* *prevcount-variable*
v:prevcount
		The count given for the last but one Normal mode command.
		This is the v:count value of the previous command.  Useful if
		you want to cancel Visual or Operator-pending mode and then
		use the count, e.g.: >vim
		  :vmap % <Esc>:call MyFilter(v:prevcount)<CR>
<
		Read-only.

				*v:profiling* *profiling-variable*
v:profiling
		Normally zero.  Set to one after using ":profile start".
		See |profiling|.

					*v:progname* *progname-variable*
v:progname
		The name by which Nvim was invoked (with path removed).
		Read-only.

					*v:progpath* *progpath-variable*
v:progpath
		Absolute path to the current running Nvim.
		Read-only.

					*v:register* *register-variable*
v:register
		The name of the register in effect for the current normal mode
		command (regardless of whether that command actually used a
		register).  Or for the currently executing normal mode mapping
		(use this in custom commands that take a register).
		If none is supplied it is the default register '"', unless
		'clipboard' contains "unnamed" or "unnamedplus", then it is
		"*" or '+'.
		Also see |getreg()| and |setreg()|

					*v:relnum* *relnum-variable*
v:relnum
		Relative line number for the 'statuscolumn' expression.
		Read-only.

				*v:scrollstart* *scrollstart-variable*
v:scrollstart
		String describing the script or function that caused the
		screen to scroll up.  It's only set when it is empty, thus the
		first reason is remembered.  It is set to "Unknown" for a
		typed command.
		This can be used to find out why your script causes the
		hit-enter prompt.

			*v:searchforward* *searchforward-variable*
v:searchforward
		Search direction:  1 after a forward search, 0 after a
		backward search.  It is reset to forward when directly setting
		the last search pattern, see |quote/|.
		Note that the value is restored when returning from a
		function. |function-search-undo|.
		Read-write.

				*v:servername* *servername-variable*
v:servername
		Primary listen-address of Nvim, the first item returned by
		|serverlist()|. Usually this is the named pipe created by Nvim
		at |startup| or given by |--listen| (or the deprecated
		|$NVIM_LISTEN_ADDRESS| env var).

		See also |serverstart()| |serverstop()|.
		Read-only.

		                                                     *$NVIM*
		$NVIM is set to v:servername by |terminal| and |jobstart()|,
		and is thus a hint that the current environment is a child
		(direct subprocess) of Nvim.

		Example: a child Nvim process can detect and make requests to
		its parent Nvim: >lua

		  if vim.env.NVIM then
		    local ok, chan = pcall(vim.fn.sockconnect, 'pipe', vim.env.NVIM, {rpc=true})
		    if ok and chan then
		      local client = vim.api.nvim_get_chan_info(chan).client
		      local rv = vim.rpcrequest(chan, 'nvim_exec_lua', [[return ... + 1]], { 41 })
		      vim.print(('got "%s" from parent Nvim'):format(rv))
		    end
		  end
<

				*v:shell_error* *shell_error-variable*
v:shell_error
		Result of the last shell command.  When non-zero, the last
		shell command had an error.  When zero, there was no problem.
		This only works when the shell returns the error code to Vim.
		The value -1 is often used when the command could not be
		executed.  Read-only.
		Example: >vim
		  !mv foo bar
		  if v:shell_error
		    echo 'could not rename "foo" to "bar"!'
		  endif
<

				*v:stacktrace* *stacktrace-variable*
v:stacktrace
		The stack trace of the exception most recently caught and
		not finished.  Refer to |getstacktrace()| for the structure of
		stack trace.  See also |v:exception|, |v:throwpoint|, and
		|throw-variables|.

				*v:statusmsg* *statusmsg-variable*
v:statusmsg
		Last given status message.

Title: Nvim Predefined Variables: Option Type, Counts, Profiling, Program Name, Registers, and Search
Summary
This section describes several predefined variables in Nvim. It covers 'v:option_type', the scope of the set command during OptionSet autocommands; 'v:prevcount', the count of the previous Normal mode command; 'v:profiling', indicating whether profiling is active; 'v:progname' and 'v:progpath' which hold the program name and path; 'v:register', the name of the current register; 'v:relnum', the relative line number for statuscolumn; 'v:scrollstart', the script that caused the screen to scroll; 'v:searchforward', the search direction; 'v:servername', the primary listen-address of Nvim; '$NVIM', which is set to v:servername by terminal and jobstart(); 'v:shell_error', the result of the last shell command; 'v:stacktrace', the stack trace of the most recently caught exception; and 'v:statusmsg', the last given status message.