Mercurial > vim
comparison runtime/doc/eval.txt @ 16366:6ee80f3b5ea9 v8.1.1188
patch 8.1.1188: not all Vim variables require the v: prefix
commit https://github.com/vim/vim/commit/d2e716e6dfd50b605867c7c684373384c8edf707
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Apr 20 14:39:52 2019 +0200
patch 8.1.1188: not all Vim variables require the v: prefix
Problem: Not all Vim variables require the v: prefix.
Solution: When scriptversion is 3 all Vim variables can only be used with
the v: prefix. (Ken Takata, closes #4274)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 20 Apr 2019 14:45:06 +0200 |
parents | 243cdc183ec9 |
children | 5ad204d8a2f2 |
comparison
equal
deleted
inserted
replaced
16365:957aa26b475b | 16366:6ee80f3b5ea9 |
---|---|
1686 < Note: The <C-U> is required to remove the line range that you | 1686 < Note: The <C-U> is required to remove the line range that you |
1687 get when typing ':' after a count. | 1687 get when typing ':' after a count. |
1688 When there are two counts, as in "3d2w", they are multiplied, | 1688 When there are two counts, as in "3d2w", they are multiplied, |
1689 just like what happens in the command, "d6w" for the example. | 1689 just like what happens in the command, "d6w" for the example. |
1690 Also used for evaluating the 'formatexpr' option. | 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 *v:count1* *count1-variable* | 1694 *v:count1* *count1-variable* |
1694 v:count1 Just like "v:count", but defaults to one when no count is | 1695 v:count1 Just like "v:count", but defaults to one when no count is |
1695 used. | 1696 used. |
1696 | 1697 |
1718 Example: > | 1719 Example: > |
1719 :let v:errmsg = "" | 1720 :let v:errmsg = "" |
1720 :silent! next | 1721 :silent! next |
1721 :if v:errmsg != "" | 1722 :if v:errmsg != "" |
1722 : ... handle error | 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 *v:errors* *errors-variable* *assert-return* | 1727 *v:errors* *errors-variable* *assert-return* |
1726 v:errors Errors found by assert functions, such as |assert_true()|. | 1728 v:errors Errors found by assert functions, such as |assert_true()|. |
1727 This is a list of strings. | 1729 This is a list of strings. |
1728 The assert functions append an item when an assert fails. | 1730 The assert functions append an item when an assert fails. |
2021 Example: > | 2023 Example: > |
2022 :!mv foo bar | 2024 :!mv foo bar |
2023 :if v:shell_error | 2025 :if v:shell_error |
2024 : echo 'could not rename "foo" to "bar"!' | 2026 : echo 'could not rename "foo" to "bar"!' |
2025 :endif | 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 *v:statusmsg* *statusmsg-variable* | 2031 *v:statusmsg* *statusmsg-variable* |
2029 v:statusmsg Last given status message. It's allowed to set this variable. | 2032 v:statusmsg Last given status message. It's allowed to set this variable. |
2030 | 2033 |
2031 *v:swapname* *swapname-variable* | 2034 *v:swapname* *swapname-variable* |
2121 | 2124 |
2122 *v:this_session* *this_session-variable* | 2125 *v:this_session* *this_session-variable* |
2123 v:this_session Full filename of the last loaded or saved session file. See | 2126 v:this_session Full filename of the last loaded or saved session file. See |
2124 |:mksession|. It is allowed to set this variable. When no | 2127 |:mksession|. It is allowed to set this variable. When no |
2125 session file has been saved, this variable is empty. | 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 *v:throwpoint* *throwpoint-variable* | 2132 *v:throwpoint* *throwpoint-variable* |
2129 v:throwpoint The point where the exception most recently caught and not | 2133 v:throwpoint The point where the exception most recently caught and not |
2130 finished was thrown. Not set when commands are typed. See | 2134 finished was thrown. Not set when commands are typed. See |
2131 also |v:exception| and |throw-variables|. | 2135 also |v:exception| and |throw-variables|. |
2152 | 2156 |
2153 *v:version* *version-variable* | 2157 *v:version* *version-variable* |
2154 v:version Version number of Vim: Major version number times 100 plus | 2158 v:version Version number of Vim: Major version number times 100 plus |
2155 minor version number. Version 5.0 is 500. Version 5.1 (5.01) | 2159 minor version number. Version 5.0 is 500. Version 5.1 (5.01) |
2156 is 501. Read-only. "version" also works, for backwards | 2160 is 501. Read-only. "version" also works, for backwards |
2157 compatibility. | 2161 compatibility, unless |scriptversion| is 3 or higher. |
2158 Use |has()| to check if a certain patch was included, e.g.: > | 2162 Use |has()| to check if a certain patch was included, e.g.: > |
2159 if has("patch-7.4.123") | 2163 if has("patch-7.4.123") |
2160 < Note that patch numbers are specific to the version, thus both | 2164 < Note that patch numbers are specific to the version, thus both |
2161 version 5.0 and 5.1 may have a patch 123, but these are | 2165 version 5.0 and 5.1 may have a patch 123, but these are |
2162 completely different. | 2166 completely different. |