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* *echospace-variable*
v:echospace
Number of screen cells that can be used for an `:echo` message
in the last screen line before causing the |hit-enter-prompt|.
Depends on 'showcmd', 'ruler' and 'columns'. You need to
check 'cmdheight' for whether there are full-width lines
available above the last line.
*v:errmsg* *errmsg-variable*
v:errmsg
Last given error message.
Modifiable (can be set).
Example: >vim
let v:errmsg = ""
silent! next
if v:errmsg != ""
" ... handle error
<
*v:errors* *errors-variable* *assert-return*
v:errors
Errors found by assert functions, such as |assert_true()|.
This is a list of strings.
The assert functions append an item when an assert fails.
The return value indicates this: a one is returned if an item
was added to v:errors, otherwise zero is returned.
To remove old results make it empty: >vim
let v:errors = []
<
If v:errors is set to anything but a list it is made an empty
list by the assert function.
*v:event* *event-variable*
v:event
Dictionary of event data for the current |autocommand|. Valid
only during the event lifetime; storing or passing v:event is
invalid! Copy it instead: >vim
au TextYankPost * let g:foo = deepcopy(v:event)
<
Keys vary by event; see the documentation for the specific
event, e.g. |DirChanged| or |TextYankPost|.
KEY DESCRIPTION ~
abort Whether the event triggered during
an aborting condition (e.g. |c_Esc| or
|c_CTRL-C| for |CmdlineLeave|).
chan |channel-id|
changed_window Is |v:true| if the event fired while
changing window (or tab) on |DirChanged|.
cmdlevel Level of cmdline.
cmdtype Type of cmdline, |cmdline-char|.
col Column count of popup menu on |CompleteChanged|,
relative to screen.
complete_type See |complete_info_mode|
complete_word The selected word, or empty if completion
was abandoned/discarded.
completed_item Current selected item on |CompleteChanged|,
or `{}` if no item selected.
cwd Current working directory.
height Height of popup menu on |CompleteChanged|
inclusive Motion is |inclusive|, else exclusive.
info Dict of arbitrary event data.
operator Current |operator|. Also set for Ex
commands (unlike |v:operator|). For
example if |TextYankPost| is triggered
by the |:yank| Ex command then
`v:event.operator` is "y".
reason |CompleteDone| reason.
regcontents Text stored in the register as a
|readfile()|-style list of lines.
regname Requested register (e.g "x" for "xyy), or
empty string for an unnamed operation.
regtype