summaryrefslogtreecommitdiff
path: root/runtime/doc/usr_41.txt
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc/usr_41.txt')
-rw-r--r--runtime/doc/usr_41.txt13
1 files changed, 8 insertions, 5 deletions
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index 0219b9886..bde1dd1dd 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -1,4 +1,4 @@
-*usr_41.txt* For Vim version 8.2. Last change: 2020 Jun 01
+*usr_41.txt* For Vim version 8.2. Last change: 2020 Jun 13
VIM USER MANUAL - by Bram Moolenaar
@@ -41,10 +41,11 @@ prefer. And you can use any colon command in it (commands that start with a
specific file type. A complicated macro can be defined by a separate Vim
script file. You can think of other uses yourself.
-Note: if you are familiar with Python, you can find a comparison between
-Python and Vim script here, with pointers to other documents:
- https://gist.github.com/yegappan/16d964a37ead0979b05e655aa036cad0
-
+ If you are familiar with Python, you can find a comparison between
+ Python and Vim script here, with pointers to other documents:
+ https://gist.github.com/yegappan/16d964a37ead0979b05e655aa036cad0
+ And if you are familiar with Javascript:
+ https://w0rp.com/blog/post/vim-script-for-the-javascripter/
Let's start with a simple example: >
@@ -98,6 +99,8 @@ and the value of the variable i. Since i is one, this will print:
Then there is the ":let i += 1" command. This does the same thing as
":let i = i + 1". This adds one to the variable i and assigns the new value
to the same variable.
+Note: this is how it works in legacy Vim script, which is what we discuss in
+this file. In Vim9 script it's a bit different, see |usr_46.txt|.
The example was given to explain the commands, but would you really want to
make such a loop, it can be written much more compact: >