diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 0e6ec19ff8..5a0dd4f2d7 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -120,9 +120,6 @@ else com! -nargs=* VimFoldt endif -" commands not picked up by the generator (due to non-standard format) {{{2 -syn keyword vimCommand contained py3 - " Deprecated variable options {{{2 if exists("g:vim_minlines") let g:vimsyn_minlines= g:vim_minlines diff --git a/scripts/genvimvim.lua b/scripts/genvimvim.lua index ff60b6cce7..7e9d649cb4 100644 --- a/scripts/genvimvim.lua +++ b/scripts/genvimvim.lua @@ -44,12 +44,13 @@ local function cmd_kw(prev_cmd, cmd) end -- Exclude these from the vimCommand keyword list, they are handled specially --- in syntax/vim.vim (vimAugroupKey, vimAutoCmd). #9327 -local function is_autocmd_cmd(cmd) +-- in syntax/vim.vim (vimAugroupKey, vimAutoCmd, vimSubst). #9327 +local function is_special_cased_cmd(cmd) return (cmd == 'augroup' or cmd == 'autocmd' or cmd == 'doautocmd' - or cmd == 'doautoall') + or cmd == 'doautoall' + or cmd == 'substitute') end local vimcmd_start = 'syn keyword vimCommand contained ' @@ -60,7 +61,7 @@ for _, cmd_desc in ipairs(ex_cmds.cmds) do w('\n' .. vimcmd_start) end local cmd = cmd_desc.command - if cmd:match('%w') and cmd ~= 'z' and not is_autocmd_cmd(cmd) then + if cmd:match('%w') and cmd ~= 'z' and not is_special_cased_cmd(cmd) then w(' ' .. cmd_kw(prev_cmd, cmd)) end prev_cmd = cmd