-*vim9.txt* For Vim version 9.1. Last change: 2025 Aug 27
+*vim9.txt* For Vim version 9.1. Last change: 2025 Sep 30
VIM REFERENCE MANUAL by Bram Moolenaar
In the |vimrc| file sourced on startup this does not happen.
*vim9-mix*
-There is one way to use both legacy and Vim9 syntax in one script file: >
- " comments may go here
+There is one way to use both legacy and Vim9 syntax in one script file: >vim9
+
+ " legacy Vim script comments may go here
if !has('vim9script')
- " legacy script commands go here
+ " legacy Vim script commands go here
finish
endif
vim9script
# Vim9 script commands go here
+
This allows for writing a script that takes advantage of the Vim9 script
syntax if possible, but will also work on a Vim version without it.
" Vim syntax file
" Language: Vim help file
" Maintainer: Doug Kearns <dougkearns@gmail.com>
-" Last Change: 2025 Sep 27
+" Last Change: 2025 Sep 29
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" Quit when a (custom) syntax file was already loaded
endfor
unlet! s:lang s:syntax
+if has_key(g:help_example_languages, "vim9")
+ " for example at :help vim9-mix
+ syn region vim9LegacyHeader_HelpExample
+ \ start=+" legacy Vim script comments may go here+
+ \ end="^\ze\s*vim9s\%[cript]\>"
+ \ contains=@vimLegacyTop,vimComment,vimLineComment
+ syn cluster helpExampleHighlight_vim9 add=vim9LegacyHeader_HelpExample
+endif
+
if has("ebcdic")
syn match helpHyperTextJump "\\\@<!|[^"*|]\+|" contains=helpBar
syn match helpHyperTextEntry "\*[^"*|]\+\*\s"he=e-1 contains=helpStar
|h|o|w|e|v|e|r|,| |t|h|a|t| |a|n|y| |l|o|n|g| |d|i|r|e|c|t|o|r|y| |n|a|m|e|s| |w|i|l@1| |a|p@1|e|a|r| |i|n| |t|h|e|i|r| |s|h|o|r|t| |(|M|S|-|D|O|S|)|
|f|o|r|m| |o|n| |s|o|m|e| |W|i|n|d|o|w|s| |v|e|r|s|i|o|n|s|.| @1|T|h|i|s| |i|s| |a| |l|i|m|i|t|a|t|i|o|n| |o|f| |t|h|e| |W|i|n|d|o|w|s| |"|S|e|n|d| |T
|o|"| @72
-@57|1|9|,|1| @9|8|1|%|
+@57|1|9|,|1| @9|4|0|%|
|o|"| @72
|m|e|c|h|a|n|i|s|m|.| @64
@75
->v|i|m|:| |s|e|t| |f|t|=|h|e|l|p|:| @57
-|~+0#4040ff13&| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-| +0#0000000&@56|3@1|,|1| @9|B|o|t|
+@75
+>E+0#e000e06&|X|A|M|P|L|E| |L|A|N|G|U|A|G|E|S|~+0#ffffff16&| +0#0000000&@56
+@56|*+0#ffffff16&|v+0#e000002&|i|m|9|-|m|i|x|*+0#ffffff16&| +0#0000000&@8
+|T|h|e|r|e| |i|s| |o|n|e| |w|a|y| |t|o| |u|s|e| |b|o|t|h| |l|e|g|a|c|y| |a|n|d| |V|i|m|9| |s|y|n|t|a|x| |i|n| |o|n|e| |s|c|r|i|p|t| |f|i|l|e|:| +0#ffffff16&|>|v|i
+|m|9| +0#0000000&@72
+@75
+@8|"+0#0000e05&| |l|e|g|a|c|y| |V|i|m| |s|c|r|i|p|t| |c|o|m@1|e|n|t|s| |m|a|y| |g|o| |h|e|r|e| +0#0000000&@26
+@8|i+0#af5f00255&|f| +0#0000000&|!+0#af5f00255&|h+0#00e0e07&|a|s|(+0#e000e06&|'+0#e000002&|v|i|m|9|s|c|r|i|p|t|'|)+0#e000e06&| +0#0000000&@45
+@11|"+0#0000e05&| |l|e|g|a|c|y| |V|i|m| |s|c|r|i|p|t| |c|o|m@1|a|n|d|s| |g|o| |h|e|r|e| +0#0000000&@27
+@11|f+0#af5f00255&|i|n|i|s|h| +0#0000000&@57
+@8|e+0#af5f00255&|n|d|i|f| +0#0000000&@61
+@8|v+0#af5f00255&|i|m|9|s|c|r|i|p|t| +0#0000000&@56
+@8|#+0#0000e05&| |V|i|m|9| |s|c|r|i|p|t| |c|o|m@1|a|n|d|s| |g|o| |h|e|r|e| +0#0000000&@36
+@75
+|T|h|i|s| |a|l@1|o|w|s| |f|o|r| |w|r|i|t|i|n|g| |a| |s|c|r|i|p|t| |t|h|a|t| |t|a|k|e|s| |a|d|v|a|n|t|a|g|e| |o|f| |t|h|e| |V|i|m|9| |s|c|r|i|p|t| @2
+@57|3|4|,|1| @9|9|0|%|
--- /dev/null
+|T+0&#ffffff0|h|i|s| |a|l@1|o|w|s| |f|o|r| |w|r|i|t|i|n|g| |a| |s|c|r|i|p|t| |t|h|a|t| |t|a|k|e|s| |a|d|v|a|n|t|a|g|e| |o|f| |t|h|e| |V|i|m|9| |s|c|r|i|p|t| @2
+|s|y|n|t|a|x| |i|f| |p|o|s@1|i|b|l|e|,| |b|u|t| |w|i|l@1| |a|l|s|o| |w|o|r|k| |o|n| |a| |V|i|m| |v|e|r|s|i|o|n| |w|i|t|h|o|u|t| |i|t|.| @7
+@75
+@1>v|i|m|:|t|w|=|7|8|:|t|s|=|8|:|n|o|e|t|:|f|t|=|h|e|l|p|:|n|o|r|l|:| @40
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|4|9|,|2| @9|B|o|t|
form on some Windows versions. This is a limitation of the Windows "Send To"
mechanism.
-vim: set ft=help:
+
+EXAMPLE LANGUAGES~
+ *vim9-mix*
+There is one way to use both legacy and Vim9 syntax in one script file: >vim9
+
+ " legacy Vim script comments may go here
+ if !has('vim9script')
+ " legacy Vim script commands go here
+ finish
+ endif
+ vim9script
+ # Vim9 script commands go here
+
+This allows for writing a script that takes advantage of the Vim9 script
+syntax if possible, but will also work on a Vim version without it.
+
+ vim:tw=78:ts=8:noet:ft=help:norl: