From 4bba3ddeffc380d32473604f9fb7b9e60d3d9a24 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 19 Apr 2025 07:05:41 +0800 Subject: [PATCH] Support Vim9 comment syntax in legacy script --- autoload/context/commentstring.vim | 3 +++ samples/vim/example.vim | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/autoload/context/commentstring.vim b/autoload/context/commentstring.vim index 9b7883a..4a1d575 100644 --- a/autoload/context/commentstring.vim +++ b/autoload/context/commentstring.vim @@ -8,6 +8,9 @@ let g:context#commentstring#table['vim'] = { \ 'vimLuaRegion' : '--%s', \ 'vimPerlRegion' : '#%s', \ 'vimPythonRegion' : '#%s', + \ 'vimDefBody' : '#%s', + \ 'vimUserCmdBlock' : '#%s', + \ 'vimAutoCmdBlock' : '#%s', \} let g:context#commentstring#table['html'] = { diff --git a/samples/vim/example.vim b/samples/vim/example.vim index 72ecf35..1664afa 100644 --- a/samples/vim/example.vim +++ b/samples/vim/example.vim @@ -23,3 +23,18 @@ class StrawberryIcecream: print 'EAT ME' EOF endfunction + + +" Samples of Vim9 syntax in legacy script + +def TestDef() + echo ':help :def' +enddef + +command TestCommandBlock { + echo ':help :command-repl' +} + +autocmd FileType vim { + echo ':help :autocmd-block' +}