-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathtest1.vim
75 lines (75 loc) · 1.23 KB
/
test1.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
" test1
function s:foo(a, b, ...)
return 0
endfunction
function s:bar(a = 1, b = 2, ...)
return 0
endfunction
function s:baz(a, b = 2, ...)
return 0
endfunction
if 1
echo "if 1"
elseif 2
echo "elseif 2"
else
echo "else"
endif
while 1
continue
break
endwhile
for [a, b; c] in d
echo a b c
endfor
delfunction s:foo
call s:foo(1, 2, 3)
eval filter(odds, 'v:val % 2')
eval 42
let a = {"x": "y"}
let [a, b; c] = [1, 2, 3]
let [a, b; c] += [1, 2, 3]
let [a, b; c] -= [1, 2, 3]
let [a, b; c] .= [1, 2, 3]
let foo.bar.baz = 123
let foo[bar()][baz()] = 456
let foo[bar()].baz = 789
let foo[1:2] = [3, 4]
unlet a b c
lockvar a b c
lockvar 1 a b c
unlockvar a b c
unlockvar 1 a b c
try
throw "err"
catch /err/
echo "catch /err/"
catch
echo "catch"
finally
echo "finally"
endtry
echohl Error
echon "echon"
echomsg "echomsg"
echoerr "echoerr"
echoconsole "echoconsole"
execute "normal ihello"
echo [] [1,2,3] [1,2,3,]
echo {} {"x":"y"} {"x":"y","z":"w",}
echo x[0] x[y]
echo x[1:2] x[1:] x[:2] x[:]
echo x.y x.y.z
let a = 1
let a += 2
let a *= 3
let a /= 4
let a %= 5
let a ..= 'foo'
echo ('foo' .. 'bar')..'baz'
echo 'foo' .. ('bar'..'baz')
echo 'foo' .. 'bar' .. 'baz'
let a = '🐥'
const a = 1
const [a, b] = [1, 2]
const [a, b; c] = [1, 2, 3]