From 53802da38bb2134da6ec9b4e02a01ab002f2d3c6 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 24 Aug 2025 20:07:57 +0800 Subject: [PATCH 1/3] vim-patch:f66674c: runtime(fstab): Added mtab support to fstab syntax. closes: vim/vim#18074 https://github.com/vim/vim/commit/f66674cf429aa1fac79e522b45372d7e3d37a902 Co-authored-by: Radu Dineiu --- runtime/ftplugin/fstab.vim | 11 ++++++++--- runtime/syntax/fstab.vim | 29 +++++++++++++++++++++++++++-- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/runtime/ftplugin/fstab.vim b/runtime/ftplugin/fstab.vim index d340c4b8d5..dd5acfd303 100644 --- a/runtime/ftplugin/fstab.vim +++ b/runtime/ftplugin/fstab.vim @@ -2,10 +2,11 @@ " Language: fstab file " Maintainer: Radu Dineiu " URL: https://raw.github.com/rid9/vim-fstab/master/ftplugin/fstab.vim -" Last Change: 2025 Mar 31 -" Version: 1.0.1 +" Last Change: 2025 Aug 21 +" Version: 1.1.0 " " Changelog: +" - 2025 Aug 21 added support for mtab " - 2024 May 23 by Riley Bruins ('commentstring') " - 2025 Mar 31 added setlocal formatoptions-=t " @@ -20,6 +21,10 @@ let b:did_ftplugin = 1 setlocal commentstring=#\ %s setlocal formatoptions-=t -let b:undo_ftplugin = "setlocal commentstring< formatoptions<" +if expand('%:t') == 'mtab' + let b:fstab_enable_mtab = 1 +endif + +let b:undo_ftplugin = "setlocal commentstring< | setlocal formatoptions<" " vim: ts=8 ft=vim diff --git a/runtime/syntax/fstab.vim b/runtime/syntax/fstab.vim index 64d5bee3d0..442bc94f3c 100644 --- a/runtime/syntax/fstab.vim +++ b/runtime/syntax/fstab.vim @@ -2,8 +2,8 @@ " Language: fstab file " Maintainer: Radu Dineiu " URL: https://raw.github.com/rid9/vim-fstab/master/syntax/fstab.vim -" Last Change: 2024 Jul 11 -" Version: 1.6.4 +" Last Change: 2025 Aug 21 +" Version: 1.7.0 " " Credits: " David Necas (Yeti) @@ -18,6 +18,9 @@ " " let fstab_unknown_device_errors = 0 " do not highlight unknown devices as errors +" +" Changelog: +" - 2025 Aug 21 added support for mtab " quit when a syntax file was already loaded if exists("b:current_syntax") @@ -402,6 +405,28 @@ syn match fsFreqPass /\s\+.\{-}$/ contains=@fsFreqPassCluster,@fsGeneralCluster " Whole line comments syn match fsCommentLine /^#.*$/ contains=@Spell +if exists('b:fstab_enable_mtab') && b:fstab_enable_mtab == 1 + " mtab + " ---- + syn keyword fsDeviceKeyword contained binfmt_misc bpf cgroup2 configfs debugfs efivarfs fusectl hugetlbfs mqueue portal pstore securityfs udev ramfs + syn match fsDeviceKeyword contained /^systemd-1/ + syn match fsDeviceKeyword contained /^\/dev\S\+/ + + " devpts + syn match fsOptionsKeywords contained /\ Date: Sun, 24 Aug 2025 20:08:29 +0800 Subject: [PATCH 2/3] vim-patch:e06d81f: runtime(sh): add syntax highlighting support for ${ cmd;} and ${|cmd;} bash 5.3 (released July 2025) added support for ${ cmd;} and ${|cmd;} style command substitution, which is similar (but not identical) to ksh/mksh. closes: vim/vim#18084 https://github.com/vim/vim/commit/e06d81fe675794d6e849cfa78e31a78c8001bbe5 Co-authored-by: Kevin Pulo --- runtime/syntax/sh.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index 9cee161ac2..8dd62566cb 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -16,7 +16,8 @@ " 2025 May 10 improve wildcard character class lists " 2025 May 21 improve supported KornShell features " 2025 Jun 16 change how sh_fold_enabled is reset (#17557) -" 2025 Jul 18 properly delete :commands #17785 +" 2025 Jul 18 properly delete :commands (#17785) +" 2025 Aug 23 bash: add support for ${ cmd;} and ${|cmd;} (#18084) " }}} " Version: 208 " Former URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH @@ -474,6 +475,9 @@ if exists("b:is_kornshell") || exists("b:is_bash") || exists("b:is_posix") if exists("b:is_mksh") || exists("b:generic_korn") syn region shValsub matchgroup=shCmdSubRegion start="\${|" skip='\\\\\|\\.' end="}" contains=@shCommandSubList endif + elseif exists("b:is_bash") + syn region shSubshare matchgroup=shCmdSubRegion start="\${\ze[ \t\n]" skip='\\\\\|\\.' end="\zs[;\n][ \t\n]*}" contains=@shCommandSubList + syn region shValsub matchgroup=shCmdSubRegion start="\${|" skip='\\\\\|\\.' end="[;\n][ \t\n]*}" contains=@shCommandSubList endif syn region shArithmetic matchgroup=shArithRegion start="\$((" skip='\\\\\|\\.' end="))" contains=@shArithList syn region shArithmetic matchgroup=shArithRegion start="\$\[" skip='\\\\\|\\.' end="\]" contains=@shArithList @@ -677,6 +681,8 @@ if exists("b:is_kornshell") && !exists("b:is_ksh88") else syn region shDeref matchgroup=PreProc start="\${\ze[^ \t\n<]" end="}" contains=@shDerefList,shDerefVarArray nextgroup=shSpecialStart endif +elseif exists("b:is_bash") + syn region shDeref matchgroup=PreProc start="\${\ze[^ \t\n|]" end="}" contains=@shDerefList,shDerefVarArray nextgroup=shSpecialStart else syn region shDeref matchgroup=PreProc start="\${" end="}" contains=@shDerefList,shDerefVarArray nextgroup=shSpecialStart endif From 98407a8b91e102ea7f10b3d17acbb3107dee3c15 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 24 Aug 2025 20:09:17 +0800 Subject: [PATCH 3/3] vim-patch:99964e2: runtime(python): support 'type's soft keyword form `type` became a soft keyword in Python 3.12. In that form, it is a statement that declares a type alias: # type_stmt ::= 'type' identifier [type_params] "=" expression type Point = tuple[float, float] To implement support for this, this change does three things: 1. adds a `pythonType` group (linked to `Type`) 2. matches `type` followed by an identifier as `pythonStatement` 3. continues to match `type` in other forms as `pythonBuiltin` Ref: - https://docs.python.org/3/reference/lexical_analysis.html#soft-keywords - https://docs.python.org/3/reference/simple_stmts.html#the-type-statement closes: vim/vim#18090 https://github.com/vim/vim/commit/99964e2ea704465f25207c519fefb2bb6d6931bb Co-authored-by: Jon Parise --- runtime/syntax/python.vim | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/runtime/syntax/python.vim b/runtime/syntax/python.vim index eb6cb381f0..61903802a6 100644 --- a/runtime/syntax/python.vim +++ b/runtime/syntax/python.vim @@ -1,10 +1,11 @@ " Vim syntax file " Language: Python " Maintainer: Zvezdan Petkovic -" Last Change: 2025 Aug 18 +" Last Change: 2025 Aug 23 " Credits: Neil Schemenauer " Dmitry Vasiliev " Rob B +" Jon Parise " " This version is a major rewrite by Zvezdan Petkovic. " @@ -112,6 +113,7 @@ syn keyword pythonAsync async await " for more on this. syn match pythonConditional "^\s*\zscase\%(\s\+.*:.*$\)\@=" syn match pythonConditional "^\s*\zsmatch\%(\s\+.*:\s*\%(#.*\)\=$\)\@=" +syn match pythonStatement "\>>\|\.\.\.\)\s\+\)\=\zs\%(\h\|\%(\h\|[[(]\).\{-}\%(\w\|[])]\)\)\s*\n\%(\s*\.\.\.\s\)\=\s\+@\%(.\{-}\n\%(\s*\.\.\.\s\)\=\s\+@\)*" - \ contains=ALLBUT,pythonDecoratorName,pythonDecorator,pythonClass,pythonFunction,pythonDoctestValue + \ contains=ALLBUT,pythonDecoratorName,pythonDecorator,pythonClass,pythonFunction,pythonType,pythonDoctestValue \ transparent syn match pythonClass "\h\w*" display contained syn match pythonFunction "\h\w*" display contained +syn match pythonType "\h\w*" display contained syn match pythonComment "#.*$" contains=pythonTodo,@Spell syn keyword pythonTodo FIXME NOTE NOTES TODO XXX contained @@ -300,10 +303,12 @@ if !exists("python_no_builtin_highlight") syn keyword pythonBuiltin memoryview min next object oct open ord pow syn keyword pythonBuiltin print property range repr reversed round set syn keyword pythonBuiltin setattr slice sorted staticmethod str sum super - syn keyword pythonBuiltin tuple type vars zip __import__ + syn keyword pythonBuiltin tuple vars zip __import__ + " only match `type` as a builtin when it's not followed by an identifier + syn match pythonBuiltin "\>>\s\|\.\.\.\s\|"""\|'''\)\@!\S\++ end="$" \ contained @@ -387,6 +392,7 @@ hi def link pythonDecorator Define hi def link pythonDecoratorName Function hi def link pythonClass Structure hi def link pythonFunction Function +hi def link pythonType Type hi def link pythonComment Comment hi def link pythonTodo Todo hi def link pythonString String