Mercurial > vim
diff runtime/doc/vim9.txt @ 19303:51bc26d4a393
Update runtime files.
Commit: https://github.com/vim/vim/commit/560979ed4f0216f902a2c247e937f00a27dcb198
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Feb 4 22:53:05 2020 +0100
Update runtime files.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 04 Feb 2020 23:00:04 +0100 |
parents | 94eda51ba9ba |
children | 7be3663e2f2b |
line wrap: on
line diff
--- a/runtime/doc/vim9.txt +++ b/runtime/doc/vim9.txt @@ -1,4 +1,4 @@ -*vim9.txt* For Vim version 8.2. Last change: 2019 Dec 06 +*vim9.txt* For Vim version 8.2. Last change: 2020 Jan 30 VIM REFERENCE MANUAL by Bram Moolenaar @@ -113,7 +113,7 @@ used: > } echo temp " Error! -An existing variable cannot be assigend to with `:let`, since that implies a +An existing variable cannot be assigned to with `:let`, since that implies a declaration. An exception is global variables: these can be both used with and without `:let`, because there is no rule about where they are declared. @@ -128,7 +128,7 @@ Omitting :call and :eval ~ Functions can be called without `:call`: > writefile(lines, 'file') -Using `:call` is still posible, but this is discouraged. +Using `:call` is still possible, but this is discouraged. A method call without `eval` is possible, so long as the start is an identifier or can't be an Ex command. It does not work for string constants: > @@ -146,9 +146,14 @@ No curly braces expansion ~ |curly-braces-names| cannot be used. -Comperators ~ +No :append, :change or :insert ~ + +These commands are too quickly confused with local variable names. -The 'ignorecase' option is not used for comperators that use strings. + +Comparators ~ + +The 'ignorecase' option is not used for comparators that use strings. White space ~ @@ -242,6 +247,10 @@ THIS IS STILL UNDER DEVELOPMENT - ANYTHI The second and third form are optional arguments. When the caller omits an argument the {value} is used. + NOTE: It is possible to nest `:def` inside another + `:def`, but it is not possible to nest `:def` inside + `:function`, for backwards compatibility. + [!] is used as with `:function`. *:enddef* @@ -325,7 +334,7 @@ items, can then be imported in another s Namespace ~ *:vim9script* *:vim9* -To recognize an file that can be imported the `vim9script` statement must +To recognize a file that can be imported the `vim9script` statement must appear as the first statement in the file. It tells Vim to interpret the script in its own namespace, instead of the global namespace. If a file starts with: > @@ -371,7 +380,7 @@ The exported items can be imported indiv To import multiple items at the same time: > import {someValue, MyClass} from "thatscript.vim" -In case the name is ambigiuous, another name can be specified: > +In case the name is ambiguous, another name can be specified: > import MyClass as ThatClass from "myclass.vim" import {someValue, MyClass as ThatClass} from "myclass.vim" @@ -404,7 +413,7 @@ result in undefined items. Import in an autoload script ~ For optimal startup speed, loading scripts should be postponed until they are -actually needed. A recommended mechamism: +actually needed. A recommended mechanism: 1. In the plugin define user commands, functions and/or mappings that refer to an autoload script. > @@ -445,7 +454,7 @@ 9. Rationale *vim9-rationale* The :def command ~ Plugin writers have asked for a much faster Vim script. Investigation have -shown that keeping the existing semantics of funtion calls make this close to +shown that keeping the existing semantics of function calls make this close to impossible, because of the overhead involved with calling a function, setting up the local function scope and executing lines. There are many details that need to be handled, such as error messages and exceptions. The need to create @@ -483,7 +492,7 @@ JavaScript/TypeScript syntax and semanti Script writers have complained that the Vim script syntax is unexpectedly different from what they are used to. To reduce this complaint popular languages will be used as an example. At the same time, we do not want to -abondon the well-known parts of legacy Vim script. +abandon the well-known parts of legacy Vim script. Since Vim already uses `:let` and `:const` and optional type checking is desirable, the JavaScript/TypeScript syntax fits best for variable