Mercurial > vim
comparison runtime/doc/eval.txt @ 26847:eafb9fd4ec32
Update runtime files
Commit: https://github.com/vim/vim/commit/04fb916684829f6aa12f33f14d0d0023b458f200
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Dec 30 20:24:12 2021 +0000
Update runtime files
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 31 Dec 2021 13:30:06 +0100 |
parents | 629e7046ef63 |
children | fb67cd7d30a7 |
comparison
equal
deleted
inserted
replaced
26846:fbe7e8fa0d2f | 26847:eafb9fd4ec32 |
---|---|
1 *eval.txt* For Vim version 8.2. Last change: 2021 Dec 27 | 1 *eval.txt* For Vim version 8.2. Last change: 2021 Dec 28 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
1722 A variable name that is preceded with "t:" is local to the current tab page, | 1722 A variable name that is preceded with "t:" is local to the current tab page, |
1723 It is deleted when the tab page is closed. {not available when compiled | 1723 It is deleted when the tab page is closed. {not available when compiled |
1724 without the |+windows| feature} | 1724 without the |+windows| feature} |
1725 | 1725 |
1726 *global-variable* *g:var* *g:* | 1726 *global-variable* *g:var* *g:* |
1727 Inside functions global variables are accessed with "g:". Omitting this will | 1727 Inside functions and in |Vim9| script global variables are accessed with "g:". |
1728 access a variable local to a function. But "g:" can also be used in any other | 1728 Omitting this will access a variable local to a function or script. "g:" |
1729 place if you like. | 1729 can also be used in any other place if you like. |
1730 | 1730 |
1731 *local-variable* *l:var* *l:* | 1731 *local-variable* *l:var* *l:* |
1732 Inside functions local variables are accessed without prepending anything. | 1732 Inside functions local variables are accessed without prepending anything. |
1733 But you can also prepend "l:" if you like. However, without prepending "l:" | 1733 But you can also prepend "l:" if you like. However, without prepending "l:" |
1734 you may run into reserved variable names. For example "count". By itself it | 1734 you may run into reserved variable names. For example "count". By itself it |
1735 refers to "v:count". Using "l:count" you can have a local variable with the | 1735 refers to "v:count". Using "l:count" you can have a local variable with the |
1736 same name. | 1736 same name. |
1737 | 1737 |
1738 *script-variable* *s:var* | 1738 *script-variable* *s:var* |
1739 In a Vim script variables starting with "s:" can be used. They cannot be | 1739 In a legacy Vim script variables starting with "s:" can be used. They cannot |
1740 accessed from outside of the scripts, thus are local to the script. | 1740 be accessed from outside of the scripts, thus are local to the script. |
1741 In |Vim9| script the "s:" prefix can be omitted, variables are script-local by | |
1742 default. | |
1741 | 1743 |
1742 They can be used in: | 1744 They can be used in: |
1743 - commands executed while the script is sourced | 1745 - commands executed while the script is sourced |
1744 - functions defined in the script | 1746 - functions defined in the script |
1745 - autocommands defined in the script | 1747 - autocommands defined in the script |