diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-02-14 12:57:36 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-02-14 12:57:36 +0100 |
commit | 39f3b1411068ff187b4f9f482b2d6b2c1e7a7268 (patch) | |
tree | 7e5d52bcaee7087ff50014d564e33e2d3f873a64 /runtime | |
parent | 10ccfb2a17e736ace054b19dc712544b4e961671 (diff) |
patch 8.2.2511: Vim9: cannot use Vim9 script syntax in some placesv8.2.2511
Problem: Vim9: cannot use Vim9 script syntax in some places.
Solution: Add the :vim9cmd command modifier. Incompatible: Makes ":vim9"
mean ":vim9cmd" instead of ":vim9script".
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/repeat.txt | 4 | ||||
-rw-r--r-- | runtime/doc/vim9.txt | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index 195a2025a5..60ef9c1a00 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -354,13 +354,15 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|. Vim version, or update Vim to a newer version. See |vimscript-version| for what changed between versions. -:vim9[script] [noclear] *:vim9* *:vim9script* +:vim9s[cript] [noclear] *:vim9s* *:vim9script* Marks a script file as containing |Vim9-script| commands. Also see |vim9-namespace|. Must be the first command in the file. For [noclear] see |vim9-reload|. Without the |+eval| feature this changes the syntax for some commands. + See |:vim9cmd| for executing one command with Vim9 + syntax and semantics. *:scr* *:scriptnames* :scr[iptnames] List all sourced script names, in the order they were diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt index 804a98ad98..beec86fd3f 100644 --- a/runtime/doc/vim9.txt +++ b/runtime/doc/vim9.txt @@ -51,6 +51,7 @@ The Vim9 script syntax and semantics are used in: - a function defined with the `:def` command - a script file where the first command is `vim9script` - an autocommand defined in the context of the above +- a command prefixed with the `vim9cmd` command modifier When using `:function` in a Vim9 script file the legacy syntax is used, with the highest |scriptversion|. However, this can be confusing and is therefore @@ -60,6 +61,12 @@ Vim9 script and legacy Vim script can be mixed. There is no requirement to rewrite old scripts, they keep working as before. You may want to use a few `:def` functions for code that needs to be fast. + *:vim9* *:vim9cmd* +:vim9[cmd] {cmd} + Execute {cmd} using Vim9 script syntax and semantics. + Useful when typing a command and in a legacy script or + function. + ============================================================================== 2. Differences from legacy Vim script *vim9-differences* |