summaryrefslogtreecommitdiffstats
path: root/runtime/syntax/testdir/input
diff options
context:
space:
mode:
authordkearns <dougkearns@gmail.com>2023-12-11 01:53:24 +1100
committerGitHub <noreply@github.com>2023-12-10 15:53:24 +0100
commitf6869212c9e19ec8f2a4434732dd28f84f170163 (patch)
tree7ed0eacbebb49b8b115e25b56780aa40aa1294f1 /runtime/syntax/testdir/input
parent61e984e212ed19774e088868c30c2d03c4e5a0cf (diff)
runtime(vim): Update syntax file (#13653)
Improve variable highlighting in :let, :unlet, :const and :for commands. Match registers and local, global and terminal option variables. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'runtime/syntax/testdir/input')
-rw-r--r--runtime/syntax/testdir/input/vim_variables.vim127
1 files changed, 127 insertions, 0 deletions
diff --git a/runtime/syntax/testdir/input/vim_variables.vim b/runtime/syntax/testdir/input/vim_variables.vim
index 93ad6d911f..6f77da99fb 100644
--- a/runtime/syntax/testdir/input/vim_variables.vim
+++ b/runtime/syntax/testdir/input/vim_variables.vim
@@ -1,7 +1,16 @@
" Vim variable highlighting
+" :let
+
let foo = expr
+let foo[0] = expr
+
+let foo[1:2] = expr
+let foo[:2] = expr
+let foo[1:] = expr
+let foo[:] = expr
+
let foo += expr
let foo -= expr
let foo *= expr
@@ -9,3 +18,121 @@ let foo /= expr
let foo %= expr
let foo .= expr
let foo ..= expr
+
+let $FOO = expr
+let $FOO .= expr
+
+let @f = expr
+let @f .= expr
+
+let &foo = expr
+
+let &t_k1 = "\<Esc>[234;"
+
+let &foo .= expr
+
+let &foo += expr
+let &foo -= expr
+
+let &l:foo = expr
+
+let &l:foo .= expr
+let &l:foo += expr
+let &l:foo -= expr
+
+let &g:foo = expr
+
+let &g:foo .= expr
+let &g:foo += expr
+let &g:foo -= expr
+
+let [foo, bar] = expr
+let [foo,
+ \ bar] = expr
+
+let [foo, bar] .= expr
+let [foo, bar] += expr
+let [foo, bar] -= expr
+
+let [foo, bar; baz] = expr
+let [foo,
+ \ bar;
+ \ baz] = expr
+
+let [foo, bar; baz] .= expr
+let [foo, bar; baz] += expr
+let [foo, bar; baz] -= expr
+
+let foo =<< END
+...
+END
+let foo =<< trim END
+...
+END
+let foo =<< eval END
+...
+END
+let foo =<< trim eval END
+...
+END
+let foo =<< eval trim END
+...
+END
+
+let foo
+let foo bar
+
+" :unlet
+
+unlet foo
+unlet foo bar
+unlet foo
+ \ bar
+
+unlet! foo
+unlet! foo bar
+unlet! foo
+ \ bar
+
+unlet $FOO
+unlet! $FOO
+
+unlet list[3]
+unlet list[3:]
+unlet dict['two']
+unlet dict.two
+
+" :const
+
+const foo = expr
+
+const [foo, bar] = expr
+
+const [foo, bar; baz] = expr
+
+const foo =<< END
+...
+END
+const foo =<< trim END
+...
+END
+const foo =<< eval END
+...
+END
+const foo =<< trim eval END
+...
+END
+const foo =<< eval trim END
+...
+END
+
+const foo
+const foo bar
+
+" :for
+
+for foo in expr
+endfor
+
+for [foo, bar] in expr
+endfor