vim/runtime/syntax/testdir/input/vim_ex_command.vim
Doug Kearns 520a2c7852
Some checks are pending
GitHub CI / linux (gcc, true, [uchar testgui], huge, dynamic) (push) Waiting to run
GitHub CI / linux (gcc, true, [unittests], huge) (push) Waiting to run
GitHub CI / linux (i386, gcc, normal, ./src/shadow) (push) Waiting to run
GitHub CI / linux (native, clang, [], normal) (push) Waiting to run
GitHub CI / linux (native, clang, [], tiny) (push) Waiting to run
GitHub CI / linux (native, clang, true, [], huge, dynamic, stable-abi) (push) Waiting to run
GitHub CI / linux (native, gcc, [], normal) (push) Waiting to run
GitHub CI / linux (native, gcc, [], tiny) (push) Waiting to run
GitHub CI / linux (native, gcc, true, [], huge) (push) Waiting to run
GitHub CI / linux (arm64, gcc, [nogui], tiny) (push) Waiting to run
GitHub CI / linux (arm64, gcc, true, [unittests], huge) (push) Waiting to run
GitHub CI / linux (clang, [asan], huge, 5.1) (push) Waiting to run
GitHub CI / linux (clang, [nogui], tiny) (push) Waiting to run
GitHub CI / linux (gcc, [nogui], tiny) (push) Waiting to run
GitHub CI / linux (gcc, [vimtags], normal) (push) Waiting to run
GitHub CI / macos (huge, macos-13) (push) Waiting to run
GitHub CI / macos (huge, macos-15) (push) Waiting to run
GitHub CI / macos (normal, macos-13) (push) Waiting to run
GitHub CI / macos (normal, macos-15) (push) Waiting to run
GitHub CI / macos (tiny, macos-13) (push) Waiting to run
GitHub CI / macos (tiny, macos-15) (push) Waiting to run
GitHub CI / windows (no, no, x64, HUGE, stable, msvc) (push) Waiting to run
GitHub CI / windows (no, no, x86, TINY, mingw) (push) Waiting to run
GitHub CI / windows (no, yes, x64, yes, HUGE, mingw) (push) Waiting to run
GitHub CI / windows (no, yes, x86, NORMAL, msvc) (push) Waiting to run
GitHub CI / windows (yes, no, x64, NORMAL, mingw) (push) Waiting to run
GitHub CI / windows (yes, no, x86, HUGE, msvc) (push) Waiting to run
GitHub CI / windows (yes, yes, x64, TINY, msvc) (push) Waiting to run
GitHub CI / windows (yes, yes, x86, yes, HUGE, stable, mingw) (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
runtime(vim): Update base-syntax, improve :command highlighting
- Match multiline :command definitions.
- Match custom completion funcref var names.

fixes: #17001
closes: #17067

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-08 20:50:00 +02:00

144 lines
2.7 KiB
VimL

" Vim :command, :delcommand and :comclear commands
" VIM_TEST_SETUP highlight link vimUserCmdName Todo
" VIM_TEST_SETUP highlight link vimDelcommandName Todo
" list
command
command F
" define
command Foo echo "Foo"
command! Foo echo "Foo"
command! Foo echo "Foo" | echo "Bar"
command! Foo {
echo "Foo"
echo "Bar"
echo "Baz"
}
command! -addr=arguments -bang -bar -buffer -complete=arglist -count=1 -keepscript -nargs=* -range=% -register Foo echo "Foo"
command! -addr=arguments -bang -bar -buffer -complete=arglist -count=1 -keepscript -nargs=* -range=% -register Foo
\ echo "Foo"
command! -addr=arguments -bang -bar -buffer -complete=arglist -count=1 -keepscript -nargs=* -range=% -register
\ Foo
\ echo "Foo"
command! -addr=arguments -bang -bar -buffer -complete=arglist -count=1 -keepscript -nargs=* -range=% -register Foo
"\ comment
\ echo "Foo"
command! -addr=arguments -bang -bar -buffer -complete=arglist -count=1 -keepscript -nargs=* -range=% -register
"\ comment
\ Foo
"\ comment
\ echo "Foo"
command! -complete=custom,s:Completer1 Foo echo "Foo"
command! -complete=customlist,s:Completer2 Foo echo "Foo"
function Foo()
command! Foo echo "Foo (defined in :function)"
endfunction
def Foo2()
command! Foo echo "Foo (defined in :def)"
enddef
" multiline define
command! -addr=lines
\ -bang
\ -bar
\ -buffer
\ -complete=buffer
\ -count
\ -nargs=*
\ -range
\ -register
\ -keepscript
\ Foo
\ echo "Foo" |
\ echo "Bar"
command!
\ -addr=lines
\ -bang
\ -bar
\ -buffer
\ -complete=buffer
\ -count
\ -nargs=*
\ -range
\ -register
\ -keepscript
\ Foo
\ echo "Foo" |
\ echo "Bar"
command!
"\ comment
\ -addr=lines
\ -bang
"\ comment
"\ comment
\ -bar
\ -buffer
"\ comment
\ -complete=buffer
"\ comment
\ -count
"\ comment
\ -nargs=*
"\ comment
\ -range
"\ comment
\ -register
"\ comment
\ -keepscript
"\ comment
\ Foo
"\ comment
\ echo "Foo" |
"\ comment
\ echo "Bar"
" errors
command! -badattr=arguments -bang -badattr -nargs=* Foo echo "Foo"
" delete
delcommand Foo
delcommand -buffer Foo
delcommand Foo | echo "Foo"
delcommand -buffer Foo | echo "Foo"
delcommand Foo " comment
delcommand -buffer Foo " comment
comclear
comclear " comment
comclear | echo "Foo"
" Issue #14135 (vim.vim syntax highlighting broken wrt system())
com Foo call system('ls')
" Issue #17001 (Wrong vimUserCmdAttrError highlighting in vim.vim)
command! -bang -nargs=* -complete=file Make AsyncRun -program=make @ <args>