blob: 590ddd869b7e38ed093126b2fd3a7dce0ed6ff4c [file] [log] [blame]
dkearns04e53632024-04-11 06:18:37 +10001vim9script
2
3# Vim comments
4
5# Vim9-script comment
6
7 # string only recognised with leading char
8 "useless string"
9
10function! Foo()
11 " Legacy-script comment
12 # 42 " comment
13endfunction
14
15def! Bar()
16 # Vim9-script comment
17 "useless string" # comment
18enddef
19
20command -count FooCommand {
21 # Vim9-script comment
22 "useless string" # comment
23}
24
25autocmd BufNewFile * {
26 # Vim9-script comment
27 "useless string" # comment
28}
29
30
dkearns059cbe82024-06-12 03:27:53 +100031# Multiline comments
32
33# comment
34 \ continuing comment
35 \ continuing comment
36
Doug Kearnsc29b5332025-04-26 20:14:15 +020037var foo = 42 # commment
38 \ continuing comment
39 \ continuing comment
40
dkearns059cbe82024-06-12 03:27:53 +100041# :Foo
42 \ arg1
43 #\ comment
44 \ arg2
45
46echo "TOP"
47
48
49# Line-continuation comments
50
51:Foo
52 #\ line continuation comment
53 \ arg1
54 #\ line continuation comment
55 \ arg2
56
57
Doug Kearnsb9ffbf52025-04-27 19:17:06 +020058# Expression comments
59
60var foo = { # comment
61 # comment
62 bar: 42, # comment
63 # comment
64 # comment
65 baz: 42 # comment
66 # comment
67} # comment
68
69
dkearns04e53632024-04-11 06:18:37 +100070# Issue: #13047
71
72if !exists(":DiffOrig")
73 command DiffOrig vert new | set bt=nofile | r ++edit %% | 0d_ | diffthis
74 \ | wincmd p | diffthis
75endif
76
77
78# Issue: #11307 and #11560
79
80# This is what we call " blah
Doug Kearnsb9ffbf52025-04-27 19:17:06 +020081
82
83# PR: #14975
84# https://github.com/vim/vim/pull/14975#issuecomment-2832643115
85
86var d = {
87 a: 0,
88# a ' quote {{{
89#}}}
90b: 0,
91}
92