Mercurial > vim
diff runtime/doc/usr_41.txt @ 20856:83cfa1ef1bf2
Update runtime files
Commit: https://github.com/vim/vim/commit/65e0d77a66b7e50beb562ad554ace46c32ef8f0f
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 14 17:29:55 2020 +0200
Update runtime files
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 14 Jun 2020 17:45:04 +0200 |
parents | 2616c5a337e0 |
children | 1b345fb68ae3 |
line wrap: on
line diff
--- 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 comma 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 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: >