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 /\ -" 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 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