-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathindent.vader
82 lines (64 loc) · 1.05 KB
/
indent.vader
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
76
77
78
79
80
81
82
Before:
setlocal shiftwidth=2
Given graphql:
query {
Do (insert new field within query):
Gofield
Expect (new field is indented within query):
query {
field
Given graphql:
query {
field1
Do (add new field within query):
Gofield2
Expect (new field is indented at existing level):
query {
field1
field2
Given graphql:
query {
field
Do (close the existing block):
Go}
Expect (the block is closed at the original level):
query {
field
}
Given graphql:
query {
field {
id
Do (close the existing blocks):
Go}\<CR>}
Expect (existing blocks are closed at their original levels):
query {
field {
id
}
}
Given graphql:
query {
field
Do (add a comment):
Go# comment
Expect (new comment is indented at the existing level):
query {
field
# comment
Given graphql:
query {
# Comment {
field("string {") {
id
}
}
Do (reindent):
gg=G
Expect (brackets in comments and strings are ignored):
query {
# Comment {
field("string {") {
id
}
}