vvars.txt (28234B)
1 *vvars.txt* Nvim 2 3 4 NVIM REFERENCE MANUAL 5 6 7 Predefined variables *vvars* 8 9 Most variables are read-only, when a variable can be set by the user, it will 10 be mentioned at the variable description below. The type cannot be changed. 11 12 Type |gO| to see the table of contents. 13 14 *v:argf* *argf-variable* 15 v:argf 16 The list of file arguments passed on the command line at startup. 17 18 Each filename is expanded to an absolute path, so that v:argf 19 remains valid even if the current working directory changes later. 20 21 Unlike |v:argv|, this does not include option arguments 22 such as `-u`, `--cmd`, or `+cmd`. Unlike |argv()|, it is not 23 affected by later |:args|, |:argadd|, or plugin modifications. 24 It also handles the `--` separator correctly, including only 25 files specified after it. 26 27 This is a read-only snapshot of the original startup file arguments. 28 29 *v:argv* *argv-variable* 30 v:argv 31 The command line arguments Vim was invoked with. This is a 32 list of strings. The first item is the Vim command. 33 See |v:progpath| for the command with full path. 34 35 *v:char* *char-variable* 36 v:char 37 Argument for evaluating 'formatexpr' and used for the typed 38 character when using <expr> in an abbreviation |:map-<expr>|. 39 It is also used by the |InsertCharPre|, |InsertEnter|, 40 |CmdlineLeave| and |CmdlineLeavePre| events. 41 42 *v:charconvert_from* *charconvert_from-variable* 43 v:charconvert_from 44 The name of the character encoding of a file to be converted. 45 Only valid while evaluating the 'charconvert' option. 46 47 *v:charconvert_to* *charconvert_to-variable* 48 v:charconvert_to 49 The name of the character encoding of a file after conversion. 50 Only valid while evaluating the 'charconvert' option. 51 52 *v:cmdarg* *cmdarg-variable* 53 v:cmdarg 54 The extra arguments ("++p", "++enc=", "++ff=") given to a file 55 read/write command. This is set before an autocommand event 56 for a file read/write command is triggered. There is a 57 leading space to make it possible to append this variable 58 directly after the read/write command. Note: "+cmd" isn't 59 included here, because it will be executed anyway. 60 61 *v:cmdbang* *cmdbang-variable* 62 v:cmdbang 63 Set like v:cmdarg for a file read/write command. When a "!" 64 was used the value is 1, otherwise it is 0. Note that this 65 can only be used in autocommands. For user commands |<bang>| 66 can be used. 67 68 *v:collate* *collate-variable* 69 v:collate 70 The current locale setting for collation order of the runtime 71 environment. This allows Vim scripts to be aware of the 72 current locale encoding. Technical: it's the value of 73 LC_COLLATE. When not using a locale the value is "C". 74 This variable can not be set directly, use the |:language| 75 command. 76 See |multi-lang|. 77 78 *v:completed_item* *completed_item-variable* 79 v:completed_item 80 Dictionary containing the |complete-items| for the most 81 recently completed word after |CompleteDone|. Empty if the 82 completion failed, or after leaving and re-entering insert 83 mode. 84 Note: Plugins can modify the value to emulate the builtin 85 |CompleteDone| event behavior. 86 87 *v:count* *count-variable* 88 v:count 89 The count given for the last Normal mode command. Can be used 90 to get the count before a mapping. Read-only. Example: >vim 91 :map _x :<C-U>echo "the count is " .. v:count<CR> 92 < 93 Note: The <C-U> is required to remove the line range that you 94 get when typing ':' after a count. 95 When there are two counts, as in "3d2w", they are multiplied, 96 just like what happens in the command, "d6w" for the example. 97 Also used for evaluating the 'formatexpr' option. 98 99 *v:count1* *count1-variable* 100 v:count1 101 Just like "v:count", but defaults to one when no count is 102 used. 103 104 *v:ctype* *ctype-variable* 105 v:ctype 106 The current locale setting for characters of the runtime 107 environment. This allows Vim scripts to be aware of the 108 current locale encoding. Technical: it's the value of 109 LC_CTYPE. When not using a locale the value is "C". 110 This variable can not be set directly, use the |:language| 111 command. 112 See |multi-lang|. 113 114 *v:dying* *dying-variable* 115 v:dying 116 Normally zero. When a deadly signal is caught it's set to 117 one. When multiple signals are caught the number increases. 118 Can be used in an autocommand to check if Vim didn't 119 terminate normally. 120 Example: >vim 121 :au VimLeave * if v:dying | echo "\nAAAAaaaarrrggghhhh!!!\n" | endif 122 < 123 Note: if another deadly signal is caught when v:dying is one, 124 VimLeave autocommands will not be executed. 125 126 *v:echospace* *echospace-variable* 127 v:echospace 128 Number of screen cells that can be used for an `:echo` message 129 in the last screen line before causing the |hit-enter-prompt|. 130 Depends on 'showcmd', 'ruler' and 'columns'. You need to 131 check 'cmdheight' for whether there are full-width lines 132 available above the last line. 133 134 *v:errmsg* *errmsg-variable* 135 v:errmsg 136 Last error message that occurred (not necessarily displayed). 137 Modifiable (can be set). 138 Example: >vim 139 let v:errmsg = "" 140 silent! next 141 if v:errmsg != "" 142 " ... handle error 143 < 144 145 *v:errors* *errors-variable* *assert-return* 146 v:errors 147 Errors found by assert functions, such as |assert_true()|. 148 This is a list of strings. 149 The assert functions append an item when an assert fails. 150 The return value indicates this: a one is returned if an item 151 was added to v:errors, otherwise zero is returned. 152 To remove old results make it empty: >vim 153 let v:errors = [] 154 < 155 If v:errors is set to anything but a list it is made an empty 156 list by the assert function. 157 158 *v:event* *event-variable* 159 v:event 160 Dictionary of event data for the current |autocommand|. Valid 161 only during the event lifetime; storing or passing v:event is 162 invalid! Copy it instead: >vim 163 au TextYankPost * let g:foo = deepcopy(v:event) 164 < 165 Keys vary by event; see the documentation for the specific 166 event, e.g. |DirChanged| or |TextYankPost|. 167 KEY DESCRIPTION ~ 168 abort Whether the event triggered during 169 an aborting condition (e.g. |c_Esc| or 170 |c_CTRL-C| for |CmdlineLeave|). 171 chan |channel-id| 172 changed_window Is |v:true| if the event fired while 173 changing window (or tab) on |DirChanged|. 174 cmdlevel Level of cmdline. 175 cmdtype Type of cmdline, |cmdline-char|. 176 col Column count of popup menu on |CompleteChanged|, 177 relative to screen. 178 complete_type See |complete_info_mode| 179 complete_word The selected word, or empty if completion 180 was abandoned/discarded. 181 completed_item Current selected item on |CompleteChanged|, 182 or `{}` if no item selected. 183 cwd Current working directory. 184 height Height of popup menu on |CompleteChanged| 185 inclusive Motion is |inclusive|, else exclusive. 186 info Dict of arbitrary event data. 187 operator Current |operator|. Also set for Ex 188 commands (unlike |v:operator|). For 189 example if |TextYankPost| is triggered 190 by the |:yank| Ex command then 191 `v:event.operator` is "y". 192 reason |CompleteDone| reason. 193 regcontents Text stored in the register as a 194 |readfile()|-style list of lines. 195 regname Requested register (e.g "x" for "xyy), or 196 empty string for an unnamed operation. 197 regtype Type of register as returned by 198 |getregtype()|. 199 row Row count of popup menu on |CompleteChanged|, 200 relative to screen. 201 scope Event-specific scope name. 202 scrollbar |v:true| if popup menu has a scrollbar, or 203 |v:false| if not. 204 size Total number of completion items on 205 |CompleteChanged|. 206 status Job status or exit code, -1 means "unknown". |TermClose| 207 visual Selection is visual (as opposed to e.g. a motion range). 208 width Width of popup menu on |CompleteChanged| 209 windows List of window IDs that changed on |WinResized| 210 211 *v:exception* *exception-variable* 212 v:exception 213 The value of the exception most recently caught and not 214 finished. See also |v:stacktrace|, |v:throwpoint|, and 215 |throw-variables|. 216 Example: >vim 217 try 218 throw "oops" 219 catch /.*/ 220 echo "caught " .. v:exception 221 endtry 222 < 223 Output: "caught oops". 224 225 *v:exiting* *exiting-variable* 226 v:exiting 227 Exit code, or |v:null| before invoking the |VimLeavePre| 228 and |VimLeave| autocmds. See |:q|, |:x| and |:cquit|. 229 Example: >vim 230 :au VimLeave * echo "Exit value is " .. v:exiting 231 < 232 233 *v:false* *false-variable* 234 v:false 235 Special value used to put "false" in JSON and msgpack. See 236 |json_encode()|. This value is converted to "v:false" when used 237 as a String (e.g. in |expr5| with string concatenation 238 operator) and to zero when used as a Number (e.g. in |expr5| 239 or |expr7| when used with numeric operators). Read-only. 240 241 *v:fcs_choice* *fcs_choice-variable* 242 v:fcs_choice 243 What should happen after a |FileChangedShell| event was 244 triggered. Can be used in an autocommand to tell Vim what to 245 do with the affected buffer: 246 reload Reload the buffer (does not work if 247 the file was deleted). 248 edit Reload the buffer and detect the 249 values for options such as 250 'fileformat', 'fileencoding', 'binary' 251 (does not work if the file was 252 deleted). 253 ask Ask the user what to do, as if there 254 was no autocommand. Except that when 255 only the timestamp changed nothing 256 will happen. 257 <empty> Nothing, the autocommand should do 258 everything that needs to be done. 259 The default is empty. If another (invalid) value is used then 260 Vim behaves like it is empty, there is no warning message. 261 262 *v:fcs_reason* *fcs_reason-variable* 263 v:fcs_reason 264 The reason why the |FileChangedShell| event was triggered. 265 Can be used in an autocommand to decide what to do and/or what 266 to set v:fcs_choice to. Possible values: 267 deleted file no longer exists 268 conflict file contents, mode or timestamp was 269 changed and buffer is modified 270 changed file contents has changed 271 mode mode of file changed 272 time only file timestamp changed 273 274 *v:fname* *fname-variable* 275 v:fname 276 When evaluating 'includeexpr': the file name that was 277 detected. Empty otherwise. 278 279 *v:fname_diff* *fname_diff-variable* 280 v:fname_diff 281 The name of the diff (patch) file. Only valid while 282 evaluating 'patchexpr'. 283 284 *v:fname_in* *fname_in-variable* 285 v:fname_in 286 The name of the input file. Valid while evaluating: 287 option used for ~ 288 'charconvert' file to be converted 289 'diffexpr' original file 290 'patchexpr' original file 291 And set to the swap file name for |SwapExists|. 292 293 *v:fname_new* *fname_new-variable* 294 v:fname_new 295 The name of the new version of the file. Only valid while 296 evaluating 'diffexpr'. 297 298 *v:fname_out* *fname_out-variable* 299 v:fname_out 300 The name of the output file. Only valid while 301 evaluating: 302 option used for ~ 303 'charconvert' resulting converted file [1] 304 'diffexpr' output of diff 305 'patchexpr' resulting patched file 306 [1] When doing conversion for a write command (e.g., ":w 307 file") it will be equal to v:fname_in. When doing conversion 308 for a read command (e.g., ":e file") it will be a temporary 309 file and different from v:fname_in. 310 311 *v:folddashes* *folddashes-variable* 312 v:folddashes 313 Used for 'foldtext': dashes representing foldlevel of a closed 314 fold. 315 Read-only in the |sandbox|. |fold-foldtext| 316 317 *v:foldend* *foldend-variable* 318 v:foldend 319 Used for 'foldtext': last line of closed fold. 320 Read-only in the |sandbox|. |fold-foldtext| 321 322 *v:foldlevel* *foldlevel-variable* 323 v:foldlevel 324 Used for 'foldtext': foldlevel of closed fold. 325 Read-only in the |sandbox|. |fold-foldtext| 326 327 *v:foldstart* *foldstart-variable* 328 v:foldstart 329 Used for 'foldtext': first line of closed fold. 330 Read-only in the |sandbox|. |fold-foldtext| 331 332 *v:hlsearch* *hlsearch-variable* 333 v:hlsearch 334 Variable that indicates whether search highlighting is on. 335 Setting it makes sense only if 'hlsearch' is enabled. Setting 336 this variable to zero acts like the |:nohlsearch| command, 337 setting it to one acts like >vim 338 let &hlsearch = &hlsearch 339 < 340 Note that the value is restored when returning from a 341 function. |function-search-undo|. 342 343 *v:insertmode* *insertmode-variable* 344 v:insertmode 345 Used for the |InsertEnter| and |InsertChange| autocommand 346 events. Values: 347 i Insert mode 348 r Replace mode 349 v Virtual Replace mode 350 351 *v:key* *key-variable* 352 v:key 353 Key of the current item of a |Dictionary|. Only valid while 354 evaluating the expression used with |map()| and |filter()|. 355 Read-only. 356 357 *v:lang* *lang-variable* 358 v:lang 359 The current locale setting for messages of the runtime 360 environment. This allows Vim scripts to be aware of the 361 current language. Technical: it's the value of LC_MESSAGES. 362 The value is system dependent. 363 This variable can not be set directly, use the |:language| 364 command. 365 It can be different from |v:ctype| when messages are desired 366 in a different language than what is used for character 367 encoding. See |multi-lang|. 368 369 *v:lc_time* *lc_time-variable* 370 v:lc_time 371 The current locale setting for time messages of the runtime 372 environment. This allows Vim scripts to be aware of the 373 current language. Technical: it's the value of LC_TIME. 374 This variable can not be set directly, use the |:language| 375 command. See |multi-lang|. 376 377 *v:lnum* *lnum-variable* 378 v:lnum 379 Line number for the 'foldexpr' |fold-expr|, 'formatexpr', 380 'indentexpr' and 'statuscolumn' expressions, tab page number 381 for 'guitablabel' and 'guitabtooltip'. Only valid while one of 382 these expressions is being evaluated. Read-only when in the 383 |sandbox|. 384 385 *v:lua* *lua-variable* 386 v:lua 387 Prefix for calling Lua functions from expressions. 388 See |v:lua-call| for more information. 389 390 *v:maxcol* *maxcol-variable* 391 v:maxcol 392 Maximum line length. Depending on where it is used it can be 393 screen columns, characters or bytes. The value currently is 394 2147483647 on all systems. 395 396 *v:mouse_col* *mouse_col-variable* 397 v:mouse_col 398 Column number for a mouse click obtained with |getchar()|. 399 This is the screen column number, like with |virtcol()|. The 400 value is zero when there was no mouse button click. 401 402 *v:mouse_lnum* *mouse_lnum-variable* 403 v:mouse_lnum 404 Line number for a mouse click obtained with |getchar()|. 405 This is the text line number, not the screen line number. The 406 value is zero when there was no mouse button click. 407 408 *v:mouse_win* *mouse_win-variable* 409 v:mouse_win 410 Window number for a mouse click obtained with |getchar()|. 411 First window has number 1, like with |winnr()|. The value is 412 zero when there was no mouse button click. 413 414 *v:mouse_winid* *mouse_winid-variable* 415 v:mouse_winid 416 |window-ID| for a mouse click obtained with |getchar()|. 417 The value is zero when there was no mouse button click. 418 419 *v:msgpack_types* *msgpack_types-variable* 420 v:msgpack_types 421 Dictionary containing msgpack types used by |msgpackparse()| 422 and |msgpackdump()|. All types inside dictionary are fixed 423 (not editable) empty lists. To check whether some list is one 424 of msgpack types, use |is| operator. 425 426 *v:null* *null-variable* 427 v:null 428 Special value used to put "null" in JSON and NIL in msgpack. 429 See |json_encode()|. This value is converted to "v:null" when 430 used as a String (e.g. in |expr5| with string concatenation 431 operator) and to zero when used as a Number (e.g. in |expr5| 432 or |expr7| when used with numeric operators). Read-only. 433 In some places `v:null` can be used for a List, Dict, etc. 434 that is not set. That is slightly different than an empty 435 List, Dict, etc. 436 437 *v:numbermax* *numbermax-variable* 438 v:numbermax Maximum value of a number. 439 440 *v:numbermin* *numbermin-variable* 441 v:numbermin Minimum value of a number (negative). 442 443 *v:numbersize* *numbersize-variable* 444 v:numbersize 445 Number of bits in a Number. This is normally 64, but on some 446 systems it may be 32. 447 448 *v:oldfiles* *oldfiles-variable* 449 v:oldfiles 450 List of file names that is loaded from the |shada| file on 451 startup. These are the files that Vim remembers marks for. 452 The length of the List is limited by the ' argument of the 453 'shada' option (default is 100). 454 When the |shada| file is not used the List is empty. 455 Also see |:oldfiles| and |c_#<|. 456 The List can be modified, but this has no effect on what is 457 stored in the |shada| file later. If you use values other 458 than String this will cause trouble. 459 460 *v:operator* *operator-variable* 461 v:operator 462 The last operator given in Normal mode. This is a single 463 character except for commands starting with <g> or <z>, 464 in which case it is two characters. Best used alongside 465 |v:prevcount| and |v:register|. Useful if you want to cancel 466 Operator-pending mode and then use the operator, e.g.: >vim 467 :omap O <Esc>:call MyMotion(v:operator)<CR> 468 < 469 The value remains set until another operator is entered, thus 470 don't expect it to be empty. 471 v:operator is not set for |:delete|, |:yank| or other Ex 472 commands. 473 Read-only. 474 475 *v:option_command* *option_command-variable* 476 v:option_command 477 Command used to set the option. Valid while executing an 478 |OptionSet| autocommand. 479 value option was set via ~ 480 "setlocal" |:setlocal| or `:let l:xxx` 481 "setglobal" |:setglobal| or `:let g:xxx` 482 "set" |:set| or |:let| 483 "modeline" |modeline| 484 485 *v:option_new* *option_new-variable* 486 v:option_new 487 New value of the option. Valid while executing an |OptionSet| 488 autocommand. 489 490 *v:option_old* *option_old-variable* 491 v:option_old 492 Old value of the option. Valid while executing an |OptionSet| 493 autocommand. Depending on the command used for setting and 494 the kind of option this is either the local old value or the 495 global old value. 496 497 *v:option_oldglobal* *option_oldglobal-variable* 498 v:option_oldglobal 499 Old global value of the option. Valid while executing an 500 |OptionSet| autocommand. 501 502 *v:option_oldlocal* *option_oldlocal-variable* 503 v:option_oldlocal 504 Old local value of the option. Valid while executing an 505 |OptionSet| autocommand. 506 507 *v:option_type* *option_type-variable* 508 v:option_type 509 Scope of the set command. Valid while executing an 510 |OptionSet| autocommand. Can be either "global" or "local" 511 512 *v:prevcount* *prevcount-variable* 513 v:prevcount 514 The count given for the last but one Normal mode command. 515 This is the v:count value of the previous command. Useful if 516 you want to cancel Visual or Operator-pending mode and then 517 use the count, e.g.: >vim 518 :vmap % <Esc>:call MyFilter(v:prevcount)<CR> 519 < 520 Read-only. 521 522 *v:profiling* *profiling-variable* 523 v:profiling 524 Normally zero. Set to one after using ":profile start". 525 See |profiling|. 526 527 *v:progname* *progname-variable* 528 v:progname 529 The name by which Nvim was invoked (with path removed). 530 Read-only. 531 532 *v:progpath* *progpath-variable* 533 v:progpath 534 Absolute path to the current running Nvim. 535 Read-only. 536 537 *v:register* *register-variable* 538 v:register 539 The name of the register in effect for the current normal mode 540 command (regardless of whether that command actually used a 541 register). Or for the currently executing normal mode mapping 542 (use this in custom commands that take a register). 543 If none is supplied it is the default register '"', unless 544 'clipboard' contains "unnamed" or "unnamedplus", then it is 545 "*" or '+'. 546 Also see |getreg()| and |setreg()| 547 548 *v:relnum* *relnum-variable* 549 v:relnum 550 Relative line number for the 'statuscolumn' expression. 551 Read-only. 552 553 *v:scrollstart* *scrollstart-variable* 554 v:scrollstart 555 String describing the script or function that caused the 556 screen to scroll up. It's only set when it is empty, thus the 557 first reason is remembered. It is set to "Unknown" for a 558 typed command. 559 This can be used to find out why your script causes the 560 hit-enter prompt. 561 562 *v:searchforward* *searchforward-variable* 563 v:searchforward 564 Search direction: 1 after a forward search, 0 after a 565 backward search. It is reset to forward when directly setting 566 the last search pattern, see |quote/|. 567 Note that the value is restored when returning from a 568 function. |function-search-undo|. 569 Read-write. 570 571 *v:servername* *servername-variable* 572 v:servername 573 Primary listen-address of Nvim, the first item returned by 574 |serverlist()|. Usually this is the named pipe created by Nvim 575 at |startup| or given by |--listen| (or the deprecated 576 |$NVIM_LISTEN_ADDRESS| env var). 577 578 See also |serverstart()| |serverstop()|. 579 Read-only. 580 581 *$NVIM* 582 $NVIM is set to v:servername by |terminal| and |jobstart()|, 583 and is thus a hint that the current environment is a child 584 (direct subprocess) of Nvim. 585 586 Example: a child Nvim process can detect and make requests to 587 its parent Nvim: >lua 588 589 if vim.env.NVIM then 590 local ok, chan = pcall(vim.fn.sockconnect, 'pipe', vim.env.NVIM, {rpc=true}) 591 if ok and chan then 592 local client = vim.api.nvim_get_chan_info(chan).client 593 local rv = vim.rpcrequest(chan, 'nvim_exec_lua', [[return ... + 1]], { 41 }) 594 vim.print(('got "%s" from parent Nvim'):format(rv)) 595 end 596 end 597 < 598 599 *v:shell_error* *shell_error-variable* 600 v:shell_error 601 Result of the last shell command. When non-zero, the last 602 shell command had an error. When zero, there was no problem. 603 This only works when the shell returns the error code to Vim. 604 The value -1 is often used when the command could not be 605 executed. Read-only. 606 Example: >vim 607 !mv foo bar 608 if v:shell_error 609 echo 'could not rename "foo" to "bar"!' 610 endif 611 < 612 613 *v:stacktrace* *stacktrace-variable* 614 v:stacktrace 615 The stack trace of the exception most recently caught and 616 not finished. Refer to |getstacktrace()| for the structure of 617 stack trace. See also |v:exception|, |v:throwpoint|, and 618 |throw-variables|. 619 620 *v:statusmsg* *statusmsg-variable* 621 v:statusmsg 622 Last given status message. 623 Modifiable (can be set). 624 625 *v:stderr* *stderr-variable* 626 v:stderr 627 |channel-id| corresponding to stderr. The value is always 2; 628 use this variable to make your code more descriptive. 629 Unlike stdin and stdout (see |stdioopen()|), stderr is always 630 open for writing. Example: >vim 631 :call chansend(v:stderr, "error: toaster empty\n") 632 < 633 634 *v:swapchoice* *swapchoice-variable* 635 v:swapchoice 636 |SwapExists| autocommands can set this to the selected choice 637 for handling an existing swapfile: 638 'o' Open read-only 639 'e' Edit anyway 640 'r' Recover 641 'd' Delete swapfile 642 'q' Quit 643 'a' Abort 644 The value should be a single-character string. An empty value 645 results in the user being asked, as would happen when there is 646 no SwapExists autocommand. The default is empty. 647 648 *v:swapcommand* *swapcommand-variable* 649 v:swapcommand 650 Normal mode command to be executed after a file has been 651 opened. Can be used for a |SwapExists| autocommand to have 652 another Vim open the file and jump to the right place. For 653 example, when jumping to a tag the value is ":tag tagname\r". 654 For ":edit +cmd file" the value is ":cmd\r". 655 656 *v:swapname* *swapname-variable* 657 v:swapname 658 Name of the swapfile found. 659 Only valid during |SwapExists| event. 660 Read-only. 661 662 *v:t_blob* *t_blob-variable* *v:t_TYPE* 663 v:t_blob Value of |Blob| type. Read-only. See: |type()| 664 665 *v:t_bool* *t_bool-variable* 666 v:t_bool Value of |Boolean| type. Read-only. See: |type()| 667 668 *v:t_dict* *t_dict-variable* 669 v:t_dict Value of |Dictionary| type. Read-only. See: |type()| 670 671 *v:t_float* *t_float-variable* 672 v:t_float Value of |Float| type. Read-only. See: |type()| 673 674 *v:t_func* *t_func-variable* 675 v:t_func Value of |Funcref| type. Read-only. See: |type()| 676 677 *v:t_list* *t_list-variable* 678 v:t_list Value of |List| type. Read-only. See: |type()| 679 680 *v:t_number* *t_number-variable* 681 v:t_number Value of |Number| type. Read-only. See: |type()| 682 683 *v:t_string* *t_string-variable* 684 v:t_string Value of |String| type. Read-only. See: |type()| 685 686 *v:termrequest* *termrequest-variable* 687 v:termrequest 688 The value of the most recent OSC, DCS or APC control sequence 689 sent from a process running in the embedded |terminal|. 690 This can be read in a |TermRequest| event handler to respond 691 to queries from embedded applications. 692 693 *v:termresponse* *termresponse-variable* 694 v:termresponse 695 The value of the most recent OSC or DCS control sequence 696 received by Nvim from the terminal. This can be read in a 697 |TermResponse| event handler after querying the terminal using 698 another escape sequence. 699 700 *v:testing* *testing-variable* 701 v:testing Must be set before using `test_garbagecollect_now()`. 702 703 *v:this_session* *this_session-variable* 704 v:this_session 705 Full filename of the last loaded or saved session file. 706 Empty when no session file has been saved. See |:mksession|. 707 Modifiable (can be set). 708 709 *v:throwpoint* *throwpoint-variable* 710 v:throwpoint 711 The point where the exception most recently caught and not 712 finished was thrown. Not set when commands are typed. See 713 also |v:exception|, |v:stacktrace|, and |throw-variables|. 714 Example: >vim 715 try 716 throw "oops" 717 catch /.*/ 718 echo "Exception from" v:throwpoint 719 endtry 720 < 721 Output: "Exception from test.vim, line 2" 722 723 *v:true* *true-variable* 724 v:true 725 Special value used to put "true" in JSON and msgpack. See 726 |json_encode()|. This value is converted to "v:true" when used 727 as a String (e.g. in |expr5| with string concatenation 728 operator) and to one when used as a Number (e.g. in |expr5| or 729 |expr7| when used with numeric operators). Read-only. 730 731 *v:val* *val-variable* 732 v:val 733 Value of the current item of a |List| or |Dictionary|. Only 734 valid while evaluating the expression used with |map()| and 735 |filter()|. Read-only. 736 737 *v:version* *version-variable* 738 v:version 739 Vim version number: major version times 100 plus minor 740 version. Vim 5.0 is 500, Vim 5.1 is 501. 741 Read-only. 742 Use |has()| to check the Nvim (not Vim) version: >vim 743 :if has("nvim-0.2.1") 744 < 745 746 *v:versionlong* *versionlong-variable* 747 v:versionlong 748 Like v:version, but also including the patchlevel in the last 749 four digits. Version 8.1 with patch 123 has value 8010123. 750 This can be used like this: > 751 if v:versionlong >= 8010123 752 < 753 However, if there are gaps in the list of patches included 754 this will not work well. This can happen if a recent patch 755 was included into an older version, e.g. for a security fix. 756 Use the has() function to make sure the patch is actually 757 included. 758 759 *v:vim_did_enter* *vim_did_enter-variable* 760 v:vim_did_enter 761 0 during startup, 1 just before |VimEnter|. 762 Read-only. 763 764 *v:vim_did_init* *vim_did_init-variable* 765 v:vim_did_init 766 0 during initialization, 1 after sourcing |vimrc| and just 767 before |load-plugins|. 768 Read-only. 769 770 *v:virtnum* *virtnum-variable* 771 v:virtnum 772 Virtual line number for the 'statuscolumn' expression. 773 Negative when drawing the status column for virtual lines, zero 774 when drawing an actual buffer line, and positive when drawing 775 the wrapped part of a buffer line. 776 Read-only. 777 778 *v:warningmsg* *warningmsg-variable* 779 v:warningmsg 780 Last given warning message. 781 Modifiable (can be set). 782 783 *v:windowid* *windowid-variable* 784 v:windowid 785 Application-specific window "handle" which may be set by any 786 attached UI. Defaults to zero. 787 Note: For Nvim |windows| use |winnr()| or |win_getid()|, see 788 |window-ID|. 789 790 vim:tw=78:ts=8:noet:ft=help:norl: