*vvars.txt* Nvim
NVIM REFERENCE MANUAL
Predefined variables *vvars*
Most variables are read-only, when a variable can be set by the user, it will
be mentioned at the variable description below. The type cannot be changed.
Type |gO| to see the table of contents.
*v:argv* *argv-variable*
v:argv
The command line arguments Vim was invoked with. This is a
list of strings. The first item is the Vim command.
See |v:progpath| for the command with full path.
*v:char* *char-variable*
v:char
Argument for evaluating 'formatexpr' and used for the typed
character when using <expr> in an abbreviation |:map-<expr>|.
It is also used by the |InsertCharPre| and |InsertEnter| events.
*v:charconvert_from* *charconvert_from-variable*
v:charconvert_from
The name of the character encoding of a file to be converted.
Only valid while evaluating the 'charconvert' option.
*v:charconvert_to* *charconvert_to-variable*
v:charconvert_to
The name of the character encoding of a file after conversion.
Only valid while evaluating the 'charconvert' option.
*v:cmdarg* *cmdarg-variable*
v:cmdarg
The extra arguments ("++p", "++enc=", "++ff=") given to a file
read/write command. This is set before an autocommand event
for a file read/write command is triggered. There is a
leading space to make it possible to append this variable
directly after the read/write command. Note: "+cmd" isn't
included here, because it will be executed anyway.
*v:cmdbang* *cmdbang-variable*
v:cmdbang
Set like v:cmdarg for a file read/write command. When a "!"
was used the value is 1, otherwise it is 0. Note that this
can only be used in autocommands. For user commands |<bang>|
can be used.
*v:collate* *collate-variable*
v:collate
The current locale setting for collation order of the runtime
environment. This allows Vim scripts to be aware of the
current locale encoding. Technical: it's the value of
LC_COLLATE. When not using a locale the value is "C".
This variable can not be set directly, use the |:language|
command.
See |multi-lang|.
*v:completed_item* *completed_item-variable*
v:completed_item
Dictionary containing the |complete-items| for the most
recently completed word after |CompleteDone|. Empty if the
completion failed, or after leaving and re-entering insert
mode.
Note: Plugins can modify the value to emulate the builtin
|CompleteDone| event behavior.
*v:count* *count-variable*
v:count
The count given for the last Normal mode command. Can be used
to get the count before a mapping. Read-only. Example: >vim
:map _x :<C-U>echo "the count is " .. v:count<CR>
<
Note: The <C-U> is required to remove the line range that you
get when typing ':' after a count.
When there are two counts, as in "3d2w", they are multiplied,
just like what happens in the command, "d6w" for the example.
Also used for evaluating the 'formatexpr' option.
*v:count1* *count1-variable*
v:count1
Just like "v:count", but defaults to one when no count is
used.
*v:ctype* *ctype-variable*
v:ctype
The current locale setting for characters of the runtime
environment. This allows Vim scripts to be aware of the
current locale encoding. Technical: it's the value of
LC_CTYPE. When not using a locale the value is "C".
This variable can not be set directly, use the |:language|
command.
See |multi-lang|.
*v:dying* *dying-variable*
v:dying
Normally zero. When a deadly signal is caught it's set to
one. When multiple signals are caught the number increases.
Can be used in an autocommand to check if Vim didn't
terminate normally.
Example: >vim
:au VimLeave * if v:dying | echo "\nAAAAaaaarrrggghhhh!!!\n" | endif
<
Note: if another deadly signal is caught when v:dying is one,
VimLeave autocommands will not be executed.
*v:echospace*