Mercurial > vim
comparison runtime/doc/eval.txt @ 18639:cb3163d590a1
Update runtime files.
Commit: https://github.com/vim/vim/commit/09c6f265b21065ffa9437837b1d0955137175e45
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Nov 17 15:55:14 2019 +0100
Update runtime files.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 17 Nov 2019 16:00:05 +0100 |
parents | 3089b422b9dc |
children | 9007e9896303 |
comparison
equal
deleted
inserted
replaced
18638:453f4942f6cf | 18639:cb3163d590a1 |
---|---|
1 *eval.txt* For Vim version 8.1. Last change: 2019 Nov 06 | 1 *eval.txt* For Vim version 8.1. Last change: 2019 Nov 17 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
11583 | 11583 |
11584 :unlo[ckvar][!] [depth] {name} ... *:unlockvar* *:unlo* | 11584 :unlo[ckvar][!] [depth] {name} ... *:unlockvar* *:unlo* |
11585 Unlock the internal variable {name}. Does the | 11585 Unlock the internal variable {name}. Does the |
11586 opposite of |:lockvar|. | 11586 opposite of |:lockvar|. |
11587 | 11587 |
11588 *:eval* | |
11589 :eval {expr} Evaluate {expr} and discard the result. Example: > | |
11590 :eval Getlist()->Filter()->append('$') | |
11591 | |
11592 < The expression is supposed to have a side effect, | |
11593 since the resulting value is not used. In the example | |
11594 the `append()` call appends the List with text to the | |
11595 buffer. This is similar to `:call` but works with any | |
11596 expression. | |
11597 | |
11598 The command can be shortened to `:ev` or `:eva`, but | |
11599 these are hard to recognize and therefore not to be | |
11600 used. | |
11601 | |
11602 | |
11603 :if {expr1} *:if* *:end* *:endif* *:en* *E171* *E579* *E580* | 11588 :if {expr1} *:if* *:end* *:endif* *:en* *E171* *E579* *E580* |
11604 :en[dif] Execute the commands until the next matching ":else" | 11589 :en[dif] Execute the commands until the next matching ":else" |
11605 or ":endif" if {expr1} evaluates to non-zero. | 11590 or ":endif" if {expr1} evaluates to non-zero. |
11606 | 11591 |
11607 From Vim version 4.5 until 5.0, every Ex command in | 11592 From Vim version 4.5 until 5.0, every Ex command in |
11884 :echoerr "This script just failed!" | 11869 :echoerr "This script just failed!" |
11885 < If you just want a highlighted message use |:echohl|. | 11870 < If you just want a highlighted message use |:echohl|. |
11886 And to get a beep: > | 11871 And to get a beep: > |
11887 :exe "normal \<Esc>" | 11872 :exe "normal \<Esc>" |
11888 < | 11873 < |
11874 *:eval* | |
11875 :eval {expr} Evaluate {expr} and discard the result. Example: > | |
11876 :eval Getlist()->Filter()->append('$') | |
11877 | |
11878 < The expression is supposed to have a side effect, | |
11879 since the resulting value is not used. In the example | |
11880 the `append()` call appends the List with text to the | |
11881 buffer. This is similar to `:call` but works with any | |
11882 expression. | |
11883 | |
11884 The command can be shortened to `:ev` or `:eva`, but | |
11885 these are hard to recognize and therefore not to be | |
11886 used. | |
11887 | |
11888 | |
11889 *:exe* *:execute* | 11889 *:exe* *:execute* |
11890 :exe[cute] {expr1} .. Executes the string that results from the evaluation | 11890 :exe[cute] {expr1} .. Executes the string that results from the evaluation |
11891 of {expr1} as an Ex command. | 11891 of {expr1} as an Ex command. |
11892 Multiple arguments are concatenated, with a space in | 11892 Multiple arguments are concatenated, with a space in |
11893 between. To avoid the extra space use the "." | 11893 between. To avoid the extra space use the "." |