1
- *eval.txt* For Vim version 8.1. Last change: 2019 Apr 06
1
+ *eval.txt* For Vim version 8.1. Last change: 2019 Apr 21
2
2
3
3
4
4
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1688,7 +1688,8 @@ v:count The count given for the last Normal mode command. Can be used
1688
1688
When there are two counts, as in "3d2w", they are multiplied,
1689
1689
just like what happens in the command, "d6w" for the example.
1690
1690
Also used for evaluating the 'formatexpr' option.
1691
- "count" also works, for backwards compatibility.
1691
+ "count" also works, for backwards compatibility, unless
1692
+ | scriptversion | is 3 or higher.
1692
1693
1693
1694
*v:count1* *count1-variable*
1694
1695
v:count1 Just like "v:count", but defaults to one when no count is
@@ -1720,7 +1721,8 @@ v:errmsg Last given error message. It's allowed to set this variable.
1720
1721
:silent! next
1721
1722
:if v:errmsg != ""
1722
1723
: ... handle error
1723
- < "errmsg" also works, for backwards compatibility.
1724
+ < "errmsg" also works, for backwards compatibility, unless
1725
+ | scriptversion | is 3 or higher.
1724
1726
1725
1727
*v:errors* *errors-variable* *assert-return*
1726
1728
v:errors Errors found by assert functions, such as | assert_true() | .
@@ -2023,7 +2025,8 @@ v:shell_error Result of the last shell command. When non-zero, the last
2023
2025
:if v:shell_error
2024
2026
: echo 'could not rename "foo" to "bar"!'
2025
2027
:endif
2026
- < "shell_error" also works, for backwards compatibility.
2028
+ < "shell_error" also works, for backwards compatibility, unless
2029
+ | scriptversion | is 3 or higher.
2027
2030
2028
2031
*v:statusmsg* *statusmsg-variable*
2029
2032
v:statusmsg Last given status message. It's allowed to set this variable.
@@ -2123,7 +2126,8 @@ v:testing Must be set before using `test_garbagecollect_now()`.
2123
2126
v:this_session Full filename of the last loaded or saved session file. See
2124
2127
| :mksession | . It is allowed to set this variable. When no
2125
2128
session file has been saved, this variable is empty.
2126
- "this_session" also works, for backwards compatibility.
2129
+ "this_session" also works, for backwards compatibility, unless
2130
+ | scriptversion | is 3 or higher
2127
2131
2128
2132
*v:throwpoint* *throwpoint-variable*
2129
2133
v:throwpoint The point where the exception most recently caught and not
@@ -2154,7 +2158,7 @@ v:val Value of the current item of a |List| or |Dictionary|. Only
2154
2158
v:version Version number of Vim: Major version number times 100 plus
2155
2159
minor version number. Version 5.0 is 500. Version 5.1 (5.01)
2156
2160
is 501. Read-only. "version" also works, for backwards
2157
- compatibility.
2161
+ compatibility, unless | scriptversion | is 3 or higher .
2158
2162
Use | has() | to check if a certain patch was included, e.g.: >
2159
2163
if has("patch-7.4.123")
2160
2164
< Note that patch numbers are specific to the version, thus both
@@ -2675,7 +2679,7 @@ term_setkill({buf}, {how}) none set signal to stop job in terminal
2675
2679
term_setrestore({buf} , {command} ) none set command to restore terminal
2676
2680
term_setsize({buf} , {rows} , {cols} )
2677
2681
none set the size of a terminal
2678
- term_start({cmd} , {options} ) Number open a terminal window and run a job
2682
+ term_start({cmd} [ , {options} ] ) Number open a terminal window and run a job
2679
2683
term_wait({buf} [, {time} ]) Number wait for screen to be updated
2680
2684
test_alloc_fail({id} , {countdown} , {repeat} )
2681
2685
none make memory allocation fail
@@ -9436,6 +9440,7 @@ term_getcursor({buf}) *term_getcursor()*
9436
9440
is not blinking.
9437
9441
"shape" 1 for a block cursor, 2 for underline and 3
9438
9442
for a vertical bar.
9443
+ "color" color of the cursor, e.g. "green"
9439
9444
9440
9445
{buf} must be the buffer number of a terminal window. If the
9441
9446
buffer does not exist or is not a terminal window, an empty
@@ -9606,7 +9611,7 @@ term_setsize({buf}, {rows}, {cols}) *term_setsize()* *E955*
9606
9611
exist or is not a terminal window, an error is given.
9607
9612
{only available when compiled with the | +terminal | feature}
9608
9613
9609
- term_start({cmd} , {options} ) *term_start()*
9614
+ term_start({cmd} [ , {options} ]) *term_start()*
9610
9615
Open a terminal window and run {cmd} in it.
9611
9616
9612
9617
{cmd} can be a string or a List, like with | job_start() | . The
@@ -10555,6 +10560,7 @@ vim_starting True while initial source'ing takes place. |startup|
10555
10560
viminfo Compiled with viminfo support.
10556
10561
vimscript-1 Compiled Vim script version 1 support
10557
10562
vimscript-2 Compiled Vim script version 2 support
10563
+ vimscript-3 Compiled Vim script version 3 support
10558
10564
virtualedit Compiled with 'virtualedit' option. (always true)
10559
10565
visual Compiled with Visual mode. (always true)
10560
10566
visualextra Compiled with extra Visual mode commands. (always
@@ -12692,7 +12698,7 @@ code can be used: >
12692
12698
12693
12699
==============================================================================
12694
12700
10. Vim script versions *vimscript-version* *vimscript-versions*
12695
-
12701
+ *scriptversion*
12696
12702
Over time many features have been added to Vim script. This includes Ex
12697
12703
commands, functions, variable types, etc. Each individual feature can be
12698
12704
checked with the | has() | and | exists() | functions.
@@ -12713,9 +12719,14 @@ instead of failing in mysterious ways. >
12713
12719
< String concatenation with "." is not supported, use ".." instead.
12714
12720
This avoids the ambiguity using "." for Dict member access and
12715
12721
floating point numbers. Now ".5" means the number 0.5.
12716
- Test for support with: >
12717
- has('vimscript-2')
12722
+ >
12723
+ :scriptversion 3
12724
+ < All | vim-variable | s must be prefixed by "v:". E.g. "version" doesn't
12725
+ work as | v:version | anymore, it can be used as a normal variable.
12726
+ Same for some obvious names as "count" and others.
12718
12727
12728
+ Test for support with: >
12729
+ has('vimscript-3')
12719
12730
12720
12731
==============================================================================
12721
12732
11. No +eval feature *no-eval-feature*
0 commit comments