Files
Doug Kearns 21e5e76bac runtime(vim): Update base syntax, match user-command args
- Trailing bar and tail comments are not explicitly supported.  The
  command is matched to EOL.
- In Vim9 script the following always matches as an assignment:
    UserCommand = 2
  Use a leading colon to force matching the user command:
    :UserCommand = 2
- Add highlighting for utility commands VimFold\a, Vim9, and VimL.

fixes:  #20854
closes: #21035

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-08-13 18:37:58 +00:00

67 lines
968 B
VimL

" Vim user commands
" VIM_TEST_SETUP hi link vimUsrCmd vimCommand
" VIM_TEST_SETUP hi link vimUsrCmd_ vimCommand
" VIM_TEST_SETUP hi link vimUsrCmdArgs Todo
Foo
:Foo
42Foo
:42Foo
echo "..." | Foo
echo "..." | :Foo
echo "..." | 42Foo
echo "..." | :42Foo
Foo!
Foo! arg1
"\ comment
\ arg2
echo "..."
Foo arg1
"\ comment
\ arg2
echo "..."
Foo | trailing bar not supported
Foo " tail comments not supported
def Vim9Context()
Foo
:Foo
:42Foo
echo "..." | Foo
echo "..." | :Foo
echo "..." | :42Foo
Foo!
Foo! arg1
#\ comment
\ arg2
echo "..."
Foo arg1
#\ comment
\ arg2
echo "..."
Foo | trailing bar not supported
Foo # tail comments not supported
enddef
" Issue #20854 (Custom command call with the dot in the end breaks next
" highlighting)
def RunOdin()
update
if !exists("$WSL_DISTRO_NAME")
Term! odin run .
else
Term! odin run . -thread-count:1
endif
enddef