Skip to content

Commit a577e42

Browse files
dkearnschrisbra
authored andcommitted
runtime(vim): Update base-syntax, improve script-interface command highlighting
- Normalise interface heredoc highlighting with that used for :let-heredocs. - Remove interface feature testing. The Lua and Python interface command scripts are now highlighted by default. Loading all syntax files incurs an undesirable load-time burden so highlighting of the less popular MzScheme, Perl, Ruby and Tcl interfaces is disabled by default. g:vimsyn_embed can still be used to customise the supported interfaces. - Always highlight interface ex-commands as valid commands, even when the corresponding command-script highlighting is disabled. - Highlight simple command-script statements as well as heredocs. - Remove error highlighting of heredoc and statement command-script regions when an interface is disabled. These are now highlighted as plain text. - Allow indented heredoc end tokens when "trim" is specified. - Match interface heredocs in :def functions. - Fix runaway vimEmbedError regions. These regions have been removed. - Use python2 syntax for :python, and :pythonx when 'pyxversion' is appropriately set. closes: vim#15522 Signed-off-by: Doug Kearns <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 2a1e253 commit a577e42

File tree

81 files changed

+3126
-443
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+3126
-443
lines changed

runtime/doc/syntax.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*syntax.txt* For Vim version 9.1. Last change: 2025 May 10
1+
*syntax.txt* For Vim version 9.1. Last change: 2025 May 17
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -3996,6 +3996,7 @@ names whose syntax definitions will be included in Typst files. Example: >
39963996
39973997
VIM *vim.vim* *ft-vim-syntax*
39983998
*g:vimsyn_minlines* *g:vimsyn_maxlines*
3999+
39994000
There is a trade-off between more accurate syntax highlighting versus screen
40004001
updating speed. To improve accuracy, you may wish to increase the
40014002
g:vimsyn_minlines variable. The g:vimsyn_maxlines variable may be used to
@@ -4019,10 +4020,9 @@ embedded script highlighting they wish to have. >
40194020
g:vimsyn_embed =~ 'r' : support embedded Ruby
40204021
g:vimsyn_embed =~ 't' : support embedded Tcl
40214022
<
4022-
By default, g:vimsyn_embed is a string supporting interpreters that your vim
4023-
itself supports. Concatenate the indicated characters to support multiple
4024-
types of embedded interpreters (e.g., g:vimsyn_embed = "mp" supports embedded
4025-
mzscheme and embedded perl).
4023+
By default, g:vimsyn_embed is unset, and the Lua and Python script interfaces
4024+
are supported.
4025+
40264026
*g:vimsyn_folding*
40274027
Some folding is now supported with when 'foldmethod' is set to "syntax": >
40284028
@@ -4031,15 +4031,15 @@ Some folding is now supported with when 'foldmethod' is set to "syntax": >
40314031
g:vimsyn_folding =~ 'c' : fold Vim9 classes
40324032
g:vimsyn_folding =~ 'e' : fold Vim9 enums
40334033
g:vimsyn_folding =~ 'f' : fold functions
4034-
g:vimsyn_folding =~ 'h' : fold heredocs
4034+
g:vimsyn_folding =~ 'h' : fold let heredocs
40354035
g:vimsyn_folding =~ 'i' : fold Vim9 interfaces
40364036
g:vimsyn_folding =~ 'H' : fold Vim9 legacy headers
4037-
g:vimsyn_folding =~ 'l' : fold Lua script
4038-
g:vimsyn_folding =~ 'm' : fold MzScheme script
4039-
g:vimsyn_folding =~ 'p' : fold Perl script
4040-
g:vimsyn_folding =~ 'P' : fold Python script
4041-
g:vimsyn_folding =~ 'r' : fold Ruby script
4042-
g:vimsyn_folding =~ 't' : fold Tcl script
4037+
g:vimsyn_folding =~ 'l' : fold Lua heredocs
4038+
g:vimsyn_folding =~ 'm' : fold MzScheme heredocs
4039+
g:vimsyn_folding =~ 'p' : fold Perl heredocs
4040+
g:vimsyn_folding =~ 'P' : fold Python heredocs
4041+
g:vimsyn_folding =~ 'r' : fold Ruby heredocs
4042+
g:vimsyn_folding =~ 't' : fold Tcl heredocs
40434043
<
40444044

40454045
By default, g:vimsyn_folding is unset. Concatenate the indicated characters

runtime/syntax/generator/gen_syntax_vim.vim

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
" Vim syntax file generator
2-
" Language: Vim script
3-
" Maintainer: Hirohito Higashi (h_east)
4-
" Last Change: 2025 Apr 27
2+
" Language: Vim script
3+
" Maintainer: Hirohito Higashi (h_east)
4+
" Last Change: 2025 May 16
55

66
let s:keepcpo= &cpo
77
set cpo&vim
@@ -301,14 +301,32 @@ function s:get_vim_command_type(cmd_name)
301301
lvimgrep
302302
lvimgrepadd
303303
make
304+
lua
305+
luado
306+
luafile
304307
map
305308
mapclear
306309
match
310+
mzscheme
311+
mzfile
307312
noremap
308313
new
309314
normal
315+
perl
316+
perldo
310317
popup
311318
public
319+
python
320+
pyfile
321+
pydo
322+
python3
323+
py3
324+
py3do
325+
py3file
326+
pythonx
327+
pyx
328+
pyxdo
329+
pyxfile
312330
redir
313331
return
314332
set
@@ -321,6 +339,9 @@ function s:get_vim_command_type(cmd_name)
321339
static
322340
substitute
323341
syntax
342+
tcl
343+
tcldo
344+
tclfile
324345
this
325346
throw
326347
type

0 commit comments

Comments
 (0)