mirror of
https://github.com/vim/vim
synced 2025-05-02 22:37:47 +02:00
- Match variables after operators, including line continuations. - Match option variables without leading whitespace. - Explicitly match expression subscripts. - Match Vim9 variables in LHS of assignments and method calls. - Match option variables (&option) with a dedicated syntax group like environment variables. - Match list literals, fixes: #5830 - Match :{un}lockvar arguments. - Match registers and environment variables in :let unpack lists. - Match lambda expressions - Match Vim9 scope blocks - Match variables in :for subject - Highlight user variables with Normal - Improve this/super keyword matching, fixes: #15970 closes: #16476 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
60 lines
756 B
VimL
60 lines
756 B
VimL
" Vim :for command
|
|
|
|
|
|
" :for {var} in {object}
|
|
|
|
let expr = [42]
|
|
|
|
for foo in expr
|
|
echo foo
|
|
endfor
|
|
|
|
for foo in expr " comment
|
|
echo foo
|
|
endfor
|
|
|
|
for foo in
|
|
"\ comment
|
|
\ expr
|
|
echo foo
|
|
endfor
|
|
|
|
for foo in expr | echo foo | endfor
|
|
|
|
for foo in [42]
|
|
echo foo
|
|
endfor
|
|
|
|
for foo in [42] | echo foo | endfor
|
|
|
|
echo "foo" | for foo in expr
|
|
echo foo
|
|
endfor
|
|
|
|
|
|
" :for [{var1}, {var2}, ...] in {listlist}
|
|
|
|
let expr = [[42, 83]]
|
|
|
|
for [foo, bar] in expr
|
|
echo foo bar
|
|
endfor
|
|
|
|
for [foo, bar] in expr " comment
|
|
echo foo bar
|
|
endfor
|
|
|
|
for [foo, bar] in
|
|
"\ comment
|
|
\ expr
|
|
echo foo bar
|
|
endfor
|
|
|
|
for [foo, bar] in expr | echo foo bar | endfor
|
|
|
|
for [foo, bar] in [[42, 83]]
|
|
echo foo bar
|
|
endfor
|
|
|
|
for [foo, bar] in [[42, 83]] | echo foo bar | endfor
|
|
|