@enjoys/context-engine 1.3.1 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/codeActions/angular.json +126 -0
- package/data/codeActions/nestjs.json +124 -0
- package/data/codeActions/nextjs.json +198 -0
- package/data/codeActions/react.json +154 -0
- package/data/codeActions/shadcn.json +112 -0
- package/data/codeActions/shell.json +169 -26
- package/data/codeLens/angular.json +22 -0
- package/data/codeLens/nestjs.json +21 -0
- package/data/codeLens/nextjs.json +117 -0
- package/data/codeLens/react.json +89 -0
- package/data/codeLens/shadcn.json +89 -0
- package/data/codeLens/shell.json +59 -17
- package/data/codeLens/tailwindcss.json +56 -0
- package/data/color/angular.json +21 -0
- package/data/color/nestjs.json +18 -0
- package/data/color/nextjs.json +22 -0
- package/data/color/react.json +93 -0
- package/data/color/shadcn.json +66 -0
- package/data/color/shell.json +106 -80
- package/data/commands/angular.json +312 -0
- package/data/commands/manifest.json +5 -0
- package/data/commands/nestjs.json +273 -0
- package/data/commands/nextjs.json +123 -0
- package/data/commands/react.json +210 -0
- package/data/commands/shadcn.json +410 -0
- package/data/commands/shell.json +571 -41
- package/data/completion/angular.json +1490 -0
- package/data/completion/css.json +793 -0
- package/data/completion/nestjs.json +1454 -0
- package/data/completion/nextjs.json +1373 -0
- package/data/completion/react.json +1319 -0
- package/data/completion/shadcn.json +1202 -0
- package/data/completion/shell.json +2446 -510
- package/data/declaration/angular.json +46 -0
- package/data/declaration/nestjs.json +47 -0
- package/data/declaration/nextjs.json +274 -0
- package/data/declaration/react.json +199 -0
- package/data/declaration/shadcn.json +211 -0
- package/data/declaration/shell.json +343 -24
- package/data/declaration/tailwindcss.json +72 -0
- package/data/definition/angular.json +670 -0
- package/data/definition/nestjs.json +684 -0
- package/data/definition/nextjs.json +439 -0
- package/data/definition/react.json +397 -0
- package/data/definition/shadcn.json +99 -0
- package/data/definition/shell.json +820 -0
- package/data/documentHighlight/angular.json +414 -0
- package/data/documentHighlight/css.json +77 -2
- package/data/documentHighlight/nestjs.json +115 -0
- package/data/documentHighlight/nextjs.json +212 -0
- package/data/documentHighlight/react.json +119 -0
- package/data/documentHighlight/shadcn.json +168 -0
- package/data/documentHighlight/shell.json +664 -334
- package/data/documentHighlight/tailwindcss.json +105 -10
- package/data/documentRangeFormatting/angular.json +45 -0
- package/data/documentRangeFormatting/nestjs.json +17 -0
- package/data/documentRangeFormatting/nextjs.json +17 -0
- package/data/documentRangeFormatting/react.json +78 -0
- package/data/documentRangeFormatting/shadcn.json +45 -0
- package/data/documentRangeFormatting/shell.json +120 -53
- package/data/documentSymbol/angular.json +180 -0
- package/data/documentSymbol/nestjs.json +152 -0
- package/data/documentSymbol/nextjs.json +159 -0
- package/data/documentSymbol/react.json +145 -0
- package/data/documentSymbol/shadcn.json +131 -0
- package/data/documentSymbol/shell.json +166 -26
- package/data/documentSymbol/tailwindcss.json +49 -0
- package/data/foldingRange/angular.json +99 -0
- package/data/foldingRange/nestjs.json +26 -0
- package/data/foldingRange/nextjs.json +26 -0
- package/data/foldingRange/react.json +120 -0
- package/data/foldingRange/shadcn.json +93 -0
- package/data/foldingRange/shell.json +106 -46
- package/data/formatting/angular.json +21 -0
- package/data/formatting/nestjs.json +23 -0
- package/data/formatting/nextjs.json +23 -0
- package/data/formatting/react.json +71 -0
- package/data/formatting/shadcn.json +61 -0
- package/data/formatting/shell.json +103 -19
- package/data/hover/angular.json +455 -0
- package/data/hover/css.json +232 -0
- package/data/hover/nestjs.json +296 -0
- package/data/hover/nextjs.json +305 -0
- package/data/hover/react.json +173 -0
- package/data/hover/shadcn.json +450 -0
- package/data/hover/shell.json +684 -75
- package/data/implementation/angular.json +22 -0
- package/data/implementation/nestjs.json +24 -0
- package/data/implementation/nextjs.json +137 -0
- package/data/implementation/react.json +125 -0
- package/data/implementation/shadcn.json +89 -0
- package/data/implementation/shell.json +59 -3
- package/data/inlayHints/angular.json +24 -0
- package/data/inlayHints/nestjs.json +24 -0
- package/data/inlayHints/nextjs.json +143 -0
- package/data/inlayHints/react.json +177 -0
- package/data/inlayHints/shadcn.json +109 -0
- package/data/inlayHints/shell.json +223 -35
- package/data/inlineCompletions/angular.json +135 -0
- package/data/inlineCompletions/nestjs.json +25 -0
- package/data/inlineCompletions/nextjs.json +179 -0
- package/data/inlineCompletions/react.json +203 -0
- package/data/inlineCompletions/shadcn.json +115 -0
- package/data/inlineCompletions/shell.json +185 -35
- package/data/linkedEditingRange/angular.json +23 -0
- package/data/linkedEditingRange/nestjs.json +10 -0
- package/data/linkedEditingRange/nextjs.json +11 -0
- package/data/linkedEditingRange/react.json +75 -0
- package/data/linkedEditingRange/shadcn.json +23 -0
- package/data/linkedEditingRange/shell.json +25 -25
- package/data/links/angular.json +95 -0
- package/data/links/nestjs.json +130 -0
- package/data/links/nextjs.json +91 -0
- package/data/links/react.json +75 -0
- package/data/links/shadcn.json +98 -0
- package/data/links/shell.json +56 -0
- package/data/links/tailwindcss.json +25 -0
- package/data/manifest.json +339 -152
- package/data/onTypeFormatting/angular.json +14 -0
- package/data/onTypeFormatting/nestjs.json +16 -0
- package/data/onTypeFormatting/nextjs.json +17 -0
- package/data/onTypeFormatting/react.json +127 -0
- package/data/onTypeFormatting/shadcn.json +54 -0
- package/data/onTypeFormatting/shell.json +72 -68
- package/data/rangeSemanticTokens/angular.json +140 -0
- package/data/rangeSemanticTokens/nestjs.json +27 -0
- package/data/rangeSemanticTokens/nextjs.json +28 -0
- package/data/rangeSemanticTokens/react.json +216 -0
- package/data/rangeSemanticTokens/shadcn.json +140 -0
- package/data/rangeSemanticTokens/shell.json +247 -69
- package/data/rangeSemanticTokens/tailwindcss.json +99 -8
- package/data/references/angular.json +26 -0
- package/data/references/nestjs.json +24 -0
- package/data/references/nextjs.json +178 -0
- package/data/references/react.json +192 -0
- package/data/references/shadcn.json +101 -0
- package/data/references/shell.json +323 -92
- package/data/references/tailwindcss.json +66 -0
- package/data/rename/angular.json +131 -0
- package/data/rename/nestjs.json +32 -0
- package/data/rename/nextjs.json +31 -0
- package/data/rename/react.json +88 -0
- package/data/rename/shadcn.json +79 -0
- package/data/rename/shell.json +101 -31
- package/data/selectionRange/angular.json +95 -0
- package/data/selectionRange/nestjs.json +21 -0
- package/data/selectionRange/nextjs.json +22 -0
- package/data/selectionRange/react.json +87 -0
- package/data/selectionRange/shadcn.json +89 -0
- package/data/selectionRange/shell.json +65 -35
- package/data/semanticTokens/angular.json +198 -0
- package/data/semanticTokens/nestjs.json +35 -0
- package/data/semanticTokens/nextjs.json +38 -0
- package/data/semanticTokens/react.json +215 -0
- package/data/semanticTokens/shadcn.json +180 -0
- package/data/semanticTokens/shell.json +238 -65
- package/data/signatureHelp/angular.json +182 -0
- package/data/signatureHelp/nestjs.json +128 -0
- package/data/signatureHelp/nextjs.json +127 -0
- package/data/signatureHelp/react.json +281 -0
- package/data/signatureHelp/shadcn.json +237 -0
- package/data/signatureHelp/shell.json +797 -104
- package/data/typeDefinition/angular.json +362 -0
- package/data/typeDefinition/nestjs.json +334 -0
- package/data/typeDefinition/nextjs.json +285 -0
- package/data/typeDefinition/react.json +236 -0
- package/data/typeDefinition/shadcn.json +292 -0
- package/data/typeDefinition/shell.json +104 -40
- package/package.json +1 -1
- package/data/codeActions/bash.json +0 -169
- package/data/codeActions/zsh.json +0 -49
- package/data/codeLens/bash.json +0 -75
- package/data/codeLens/zsh.json +0 -19
- package/data/color/bash.json +0 -100
- package/data/color/zsh.json +0 -80
- package/data/commands/bash.json +0 -102
- package/data/commands/zsh.json +0 -166
- package/data/completion/bash.json +0 -1184
- package/data/completion/zsh.json +0 -973
- package/data/declaration/bash.json +0 -301
- package/data/declaration/zsh.json +0 -205
- package/data/definition/bash.json +0 -565
- package/data/definition/zsh.json +0 -350
- package/data/documentHighlight/bash.json +0 -393
- package/data/documentHighlight/zsh.json +0 -266
- package/data/documentRangeFormatting/bash.json +0 -41
- package/data/documentRangeFormatting/zsh.json +0 -59
- package/data/documentSymbol/bash.json +0 -124
- package/data/documentSymbol/zsh.json +0 -26
- package/data/foldingRange/bash.json +0 -76
- package/data/foldingRange/zsh.json +0 -46
- package/data/formatting/bash.json +0 -88
- package/data/formatting/zsh.json +0 -28
- package/data/hover/bash.json +0 -579
- package/data/hover/zsh.json +0 -96
- package/data/implementation/bash.json +0 -44
- package/data/implementation/zsh.json +0 -41
- package/data/inlayHints/bash.json +0 -207
- package/data/inlayHints/zsh.json +0 -43
- package/data/inlineCompletions/bash.json +0 -155
- package/data/inlineCompletions/zsh.json +0 -17
- package/data/linkedEditingRange/bash.json +0 -25
- package/data/linkedEditingRange/zsh.json +0 -25
- package/data/links/bash.json +0 -56
- package/data/links/zsh.json +0 -15
- package/data/onTypeFormatting/bash.json +0 -68
- package/data/onTypeFormatting/zsh.json +0 -68
- package/data/rangeSemanticTokens/bash.json +0 -90
- package/data/rangeSemanticTokens/zsh.json +0 -76
- package/data/references/bash.json +0 -221
- package/data/references/zsh.json +0 -166
- package/data/rename/bash.json +0 -37
- package/data/rename/zsh.json +0 -31
- package/data/selectionRange/bash.json +0 -35
- package/data/selectionRange/zsh.json +0 -35
- package/data/semanticTokens/bash.json +0 -71
- package/data/semanticTokens/zsh.json +0 -71
- package/data/signatureHelp/bash.json +0 -111
- package/data/signatureHelp/zsh.json +0 -118
- package/data/typeDefinition/bash.json +0 -95
- package/data/typeDefinition/zsh.json +0 -40
|
@@ -1,510 +1,2446 @@
|
|
|
1
|
-
{
|
|
2
|
-
"language": "shell",
|
|
3
|
-
"completions": [
|
|
4
|
-
{
|
|
5
|
-
"label": "if",
|
|
6
|
-
"kind": 13,
|
|
7
|
-
"detail": "keyword if",
|
|
8
|
-
"documentation": {
|
|
9
|
-
"value": "if keyword"
|
|
10
|
-
},
|
|
11
|
-
"insertText": "if",
|
|
12
|
-
"sortText": "00_kw"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"label": "then",
|
|
16
|
-
"kind": 13,
|
|
17
|
-
"detail": "keyword then",
|
|
18
|
-
"documentation": {
|
|
19
|
-
"value": "then keyword"
|
|
20
|
-
},
|
|
21
|
-
"insertText": "then",
|
|
22
|
-
"sortText": "00_kw"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"label": "else",
|
|
26
|
-
"kind": 13,
|
|
27
|
-
"detail": "keyword else",
|
|
28
|
-
"documentation": {
|
|
29
|
-
"value": "else keyword"
|
|
30
|
-
},
|
|
31
|
-
"insertText": "else",
|
|
32
|
-
"sortText": "00_kw"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"label": "elif",
|
|
36
|
-
"kind": 13,
|
|
37
|
-
"detail": "keyword elif",
|
|
38
|
-
"documentation": {
|
|
39
|
-
"value": "elif keyword"
|
|
40
|
-
},
|
|
41
|
-
"insertText": "elif",
|
|
42
|
-
"sortText": "00_kw"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"label": "fi",
|
|
46
|
-
"kind": 13,
|
|
47
|
-
"detail": "keyword fi",
|
|
48
|
-
"documentation": {
|
|
49
|
-
"value": "fi keyword"
|
|
50
|
-
},
|
|
51
|
-
"insertText": "fi",
|
|
52
|
-
"sortText": "00_kw"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"label": "for",
|
|
56
|
-
"kind": 13,
|
|
57
|
-
"detail": "keyword for",
|
|
58
|
-
"documentation": {
|
|
59
|
-
"value": "for keyword"
|
|
60
|
-
},
|
|
61
|
-
"insertText": "for",
|
|
62
|
-
"sortText": "00_kw"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"label": "in",
|
|
66
|
-
"kind": 13,
|
|
67
|
-
"detail": "keyword in",
|
|
68
|
-
"documentation": {
|
|
69
|
-
"value": "in keyword"
|
|
70
|
-
},
|
|
71
|
-
"insertText": "in",
|
|
72
|
-
"sortText": "00_kw"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"label": "do",
|
|
76
|
-
"kind": 13,
|
|
77
|
-
"detail": "keyword do",
|
|
78
|
-
"documentation": {
|
|
79
|
-
"value": "do keyword"
|
|
80
|
-
},
|
|
81
|
-
"insertText": "do",
|
|
82
|
-
"sortText": "00_kw"
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
"label": "done",
|
|
86
|
-
"kind": 13,
|
|
87
|
-
"detail": "keyword done",
|
|
88
|
-
"documentation": {
|
|
89
|
-
"value": "done keyword"
|
|
90
|
-
},
|
|
91
|
-
"insertText": "done",
|
|
92
|
-
"sortText": "00_kw"
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"label": "while",
|
|
96
|
-
"kind": 13,
|
|
97
|
-
"detail": "keyword while",
|
|
98
|
-
"documentation": {
|
|
99
|
-
"value": "while keyword"
|
|
100
|
-
},
|
|
101
|
-
"insertText": "while",
|
|
102
|
-
"sortText": "00_kw"
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"label": "until",
|
|
106
|
-
"kind": 13,
|
|
107
|
-
"detail": "keyword until",
|
|
108
|
-
"documentation": {
|
|
109
|
-
"value": "until keyword"
|
|
110
|
-
},
|
|
111
|
-
"insertText": "until",
|
|
112
|
-
"sortText": "00_kw"
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"label": "case",
|
|
116
|
-
"kind": 13,
|
|
117
|
-
"detail": "keyword case",
|
|
118
|
-
"documentation": {
|
|
119
|
-
"value": "case keyword"
|
|
120
|
-
},
|
|
121
|
-
"insertText": "case",
|
|
122
|
-
"sortText": "00_kw"
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
"label": "esac",
|
|
126
|
-
"kind": 13,
|
|
127
|
-
"detail": "keyword esac",
|
|
128
|
-
"documentation": {
|
|
129
|
-
"value": "esac keyword"
|
|
130
|
-
},
|
|
131
|
-
"insertText": "esac",
|
|
132
|
-
"sortText": "00_kw"
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
"label": "function",
|
|
136
|
-
"kind": 13,
|
|
137
|
-
"detail": "keyword function",
|
|
138
|
-
"documentation": {
|
|
139
|
-
"value": "function keyword"
|
|
140
|
-
},
|
|
141
|
-
"insertText": "function",
|
|
142
|
-
"sortText": "00_kw"
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
"label": "return",
|
|
146
|
-
"kind": 13,
|
|
147
|
-
"detail": "keyword return",
|
|
148
|
-
"documentation": {
|
|
149
|
-
"value": "return keyword"
|
|
150
|
-
},
|
|
151
|
-
"insertText": "return",
|
|
152
|
-
"sortText": "00_kw"
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
"label": "local",
|
|
156
|
-
"kind": 13,
|
|
157
|
-
"detail": "keyword local",
|
|
158
|
-
"documentation": {
|
|
159
|
-
"value": "local keyword"
|
|
160
|
-
},
|
|
161
|
-
"insertText": "local",
|
|
162
|
-
"sortText": "00_kw"
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
"label": "export",
|
|
166
|
-
"kind": 13,
|
|
167
|
-
"detail": "keyword export",
|
|
168
|
-
"documentation": {
|
|
169
|
-
"value": "export keyword"
|
|
170
|
-
},
|
|
171
|
-
"insertText": "export",
|
|
172
|
-
"sortText": "00_kw"
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
"label": "readonly",
|
|
176
|
-
"kind": 13,
|
|
177
|
-
"detail": "keyword readonly",
|
|
178
|
-
"documentation": {
|
|
179
|
-
"value": "readonly keyword"
|
|
180
|
-
},
|
|
181
|
-
"insertText": "readonly",
|
|
182
|
-
"sortText": "00_kw"
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
"label": "declare",
|
|
186
|
-
"kind": 13,
|
|
187
|
-
"detail": "keyword declare",
|
|
188
|
-
"documentation": {
|
|
189
|
-
"value": "declare keyword"
|
|
190
|
-
},
|
|
191
|
-
"insertText": "declare",
|
|
192
|
-
"sortText": "00_kw"
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
"label": "typeset",
|
|
196
|
-
"kind": 13,
|
|
197
|
-
"detail": "keyword typeset",
|
|
198
|
-
"documentation": {
|
|
199
|
-
"value": "typeset keyword"
|
|
200
|
-
},
|
|
201
|
-
"insertText": "typeset",
|
|
202
|
-
"sortText": "00_kw"
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
"label": "unset",
|
|
206
|
-
"kind": 13,
|
|
207
|
-
"detail": "keyword unset",
|
|
208
|
-
"documentation": {
|
|
209
|
-
"value": "unset keyword"
|
|
210
|
-
},
|
|
211
|
-
"insertText": "unset",
|
|
212
|
-
"sortText": "00_kw"
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
"label": "shift",
|
|
216
|
-
"kind": 13,
|
|
217
|
-
"detail": "keyword shift",
|
|
218
|
-
"documentation": {
|
|
219
|
-
"value": "shift keyword"
|
|
220
|
-
},
|
|
221
|
-
"insertText": "shift",
|
|
222
|
-
"sortText": "00_kw"
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
"label": "break",
|
|
226
|
-
"kind": 13,
|
|
227
|
-
"detail": "keyword break",
|
|
228
|
-
"documentation": {
|
|
229
|
-
"value": "break keyword"
|
|
230
|
-
},
|
|
231
|
-
"insertText": "break",
|
|
232
|
-
"sortText": "00_kw"
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
"label": "continue",
|
|
236
|
-
"kind": 13,
|
|
237
|
-
"detail": "keyword continue",
|
|
238
|
-
"documentation": {
|
|
239
|
-
"value": "continue keyword"
|
|
240
|
-
},
|
|
241
|
-
"insertText": "continue",
|
|
242
|
-
"sortText": "00_kw"
|
|
243
|
-
},
|
|
244
|
-
{
|
|
245
|
-
"label": "exit",
|
|
246
|
-
"kind": 13,
|
|
247
|
-
"detail": "keyword exit",
|
|
248
|
-
"documentation": {
|
|
249
|
-
"value": "exit keyword"
|
|
250
|
-
},
|
|
251
|
-
"insertText": "exit",
|
|
252
|
-
"sortText": "00_kw"
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
"label": "echo",
|
|
256
|
-
"kind": 1,
|
|
257
|
-
"detail": "builtin echo",
|
|
258
|
-
"documentation": {
|
|
259
|
-
"value": "Built-in: echo"
|
|
260
|
-
},
|
|
261
|
-
"insertText": "echo",
|
|
262
|
-
"sortText": "01_bi"
|
|
263
|
-
},
|
|
264
|
-
{
|
|
265
|
-
"label": "printf",
|
|
266
|
-
"kind": 1,
|
|
267
|
-
"detail": "builtin printf",
|
|
268
|
-
"documentation": {
|
|
269
|
-
"value": "Built-in: printf"
|
|
270
|
-
},
|
|
271
|
-
"insertText": "printf",
|
|
272
|
-
"sortText": "01_bi"
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
"label": "read",
|
|
276
|
-
"kind": 1,
|
|
277
|
-
"detail": "builtin read",
|
|
278
|
-
"documentation": {
|
|
279
|
-
"value": "Built-in: read"
|
|
280
|
-
},
|
|
281
|
-
"insertText": "read",
|
|
282
|
-
"sortText": "01_bi"
|
|
283
|
-
},
|
|
284
|
-
{
|
|
285
|
-
"label": "test",
|
|
286
|
-
"kind": 1,
|
|
287
|
-
"detail": "builtin test",
|
|
288
|
-
"documentation": {
|
|
289
|
-
"value": "Built-in: test"
|
|
290
|
-
},
|
|
291
|
-
"insertText": "test",
|
|
292
|
-
"sortText": "01_bi"
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
"label": "cd",
|
|
296
|
-
"kind": 1,
|
|
297
|
-
"detail": "builtin cd",
|
|
298
|
-
"documentation": {
|
|
299
|
-
"value": "Built-in: cd"
|
|
300
|
-
},
|
|
301
|
-
"insertText": "cd",
|
|
302
|
-
"sortText": "01_bi"
|
|
303
|
-
},
|
|
304
|
-
{
|
|
305
|
-
"label": "pwd",
|
|
306
|
-
"kind": 1,
|
|
307
|
-
"detail": "builtin pwd",
|
|
308
|
-
"documentation": {
|
|
309
|
-
"value": "Built-in: pwd"
|
|
310
|
-
},
|
|
311
|
-
"insertText": "pwd",
|
|
312
|
-
"sortText": "01_bi"
|
|
313
|
-
},
|
|
314
|
-
{
|
|
315
|
-
"label": "pushd",
|
|
316
|
-
"kind": 1,
|
|
317
|
-
"detail": "builtin pushd",
|
|
318
|
-
"documentation": {
|
|
319
|
-
"value": "Built-in: pushd"
|
|
320
|
-
},
|
|
321
|
-
"insertText": "pushd",
|
|
322
|
-
"sortText": "01_bi"
|
|
323
|
-
},
|
|
324
|
-
{
|
|
325
|
-
"label": "popd",
|
|
326
|
-
"kind": 1,
|
|
327
|
-
"detail": "builtin popd",
|
|
328
|
-
"documentation": {
|
|
329
|
-
"value": "Built-in: popd"
|
|
330
|
-
},
|
|
331
|
-
"insertText": "popd",
|
|
332
|
-
"sortText": "01_bi"
|
|
333
|
-
},
|
|
334
|
-
{
|
|
335
|
-
"label": "dirs",
|
|
336
|
-
"kind": 1,
|
|
337
|
-
"detail": "builtin dirs",
|
|
338
|
-
"documentation": {
|
|
339
|
-
"value": "Built-in: dirs"
|
|
340
|
-
},
|
|
341
|
-
"insertText": "dirs",
|
|
342
|
-
"sortText": "01_bi"
|
|
343
|
-
},
|
|
344
|
-
{
|
|
345
|
-
"label": "let",
|
|
346
|
-
"kind": 1,
|
|
347
|
-
"detail": "builtin let",
|
|
348
|
-
"documentation": {
|
|
349
|
-
"value": "Built-in: let"
|
|
350
|
-
},
|
|
351
|
-
"insertText": "let",
|
|
352
|
-
"sortText": "01_bi"
|
|
353
|
-
},
|
|
354
|
-
{
|
|
355
|
-
"label": "expr",
|
|
356
|
-
"kind": 1,
|
|
357
|
-
"detail": "builtin expr",
|
|
358
|
-
"documentation": {
|
|
359
|
-
"value": "Built-in: expr"
|
|
360
|
-
},
|
|
361
|
-
"insertText": "expr",
|
|
362
|
-
"sortText": "01_bi"
|
|
363
|
-
},
|
|
364
|
-
{
|
|
365
|
-
"label": "bc",
|
|
366
|
-
"kind": 1,
|
|
367
|
-
"detail": "builtin bc",
|
|
368
|
-
"documentation": {
|
|
369
|
-
"value": "Built-in: bc"
|
|
370
|
-
},
|
|
371
|
-
"insertText": "bc",
|
|
372
|
-
"sortText": "01_bi"
|
|
373
|
-
},
|
|
374
|
-
{
|
|
375
|
-
"label": "true",
|
|
376
|
-
"kind": 1,
|
|
377
|
-
"detail": "builtin true",
|
|
378
|
-
"documentation": {
|
|
379
|
-
"value": "Built-in: true"
|
|
380
|
-
},
|
|
381
|
-
"insertText": "true",
|
|
382
|
-
"sortText": "01_bi"
|
|
383
|
-
},
|
|
384
|
-
{
|
|
385
|
-
"label": "false",
|
|
386
|
-
"kind": 1,
|
|
387
|
-
"detail": "builtin false",
|
|
388
|
-
"documentation": {
|
|
389
|
-
"value": "Built-in: false"
|
|
390
|
-
},
|
|
391
|
-
"insertText": "false",
|
|
392
|
-
"sortText": "01_bi"
|
|
393
|
-
},
|
|
394
|
-
{
|
|
395
|
-
"label": "command",
|
|
396
|
-
"kind": 1,
|
|
397
|
-
"detail": "builtin command",
|
|
398
|
-
"documentation": {
|
|
399
|
-
"value": "Built-in: command"
|
|
400
|
-
},
|
|
401
|
-
"insertText": "command",
|
|
402
|
-
"sortText": "01_bi"
|
|
403
|
-
},
|
|
404
|
-
{
|
|
405
|
-
"label": "builtin",
|
|
406
|
-
"kind": 1,
|
|
407
|
-
"detail": "builtin builtin",
|
|
408
|
-
"documentation": {
|
|
409
|
-
"value": "Built-in: builtin"
|
|
410
|
-
},
|
|
411
|
-
"insertText": "builtin",
|
|
412
|
-
"sortText": "01_bi"
|
|
413
|
-
},
|
|
414
|
-
{
|
|
415
|
-
"label": "type",
|
|
416
|
-
"kind": 1,
|
|
417
|
-
"detail": "builtin type",
|
|
418
|
-
"documentation": {
|
|
419
|
-
"value": "Built-in: type"
|
|
420
|
-
},
|
|
421
|
-
"insertText": "type",
|
|
422
|
-
"sortText": "01_bi"
|
|
423
|
-
},
|
|
424
|
-
{
|
|
425
|
-
"label": "which",
|
|
426
|
-
"kind": 1,
|
|
427
|
-
"detail": "builtin which",
|
|
428
|
-
"documentation": {
|
|
429
|
-
"value": "Built-in: which"
|
|
430
|
-
},
|
|
431
|
-
"insertText": "which",
|
|
432
|
-
"sortText": "01_bi"
|
|
433
|
-
},
|
|
434
|
-
{
|
|
435
|
-
"label": "hash",
|
|
436
|
-
"kind": 1,
|
|
437
|
-
"detail": "builtin hash",
|
|
438
|
-
"documentation": {
|
|
439
|
-
"value": "Built-in: hash"
|
|
440
|
-
},
|
|
441
|
-
"insertText": "hash",
|
|
442
|
-
"sortText": "01_bi"
|
|
443
|
-
},
|
|
444
|
-
{
|
|
445
|
-
"label": "help",
|
|
446
|
-
"kind": 1,
|
|
447
|
-
"detail": "builtin help",
|
|
448
|
-
"documentation": {
|
|
449
|
-
"value": "Built-in: help"
|
|
450
|
-
},
|
|
451
|
-
"insertText": "help",
|
|
452
|
-
"sortText": "01_bi"
|
|
453
|
-
},
|
|
454
|
-
{
|
|
455
|
-
"label": "if_block",
|
|
456
|
-
"kind": 14,
|
|
457
|
-
"detail": "snippet if",
|
|
458
|
-
"documentation": {
|
|
459
|
-
"value": "If statement"
|
|
460
|
-
},
|
|
461
|
-
"insertText": "if [[ ${1:condition} ]]; then\n ${0}\nfi",
|
|
462
|
-
"insertTextRules": 4,
|
|
463
|
-
"sortText": "03_snip"
|
|
464
|
-
},
|
|
465
|
-
{
|
|
466
|
-
"label": "for_loop",
|
|
467
|
-
"kind": 14,
|
|
468
|
-
"detail": "snippet for",
|
|
469
|
-
"documentation": {
|
|
470
|
-
"value": "For loop"
|
|
471
|
-
},
|
|
472
|
-
"insertText": "for ${1:item} in ${2:list}; do\n ${0}\ndone",
|
|
473
|
-
"insertTextRules": 4,
|
|
474
|
-
"sortText": "03_snip"
|
|
475
|
-
},
|
|
476
|
-
{
|
|
477
|
-
"label": "function_def",
|
|
478
|
-
"kind": 14,
|
|
479
|
-
"detail": "snippet function",
|
|
480
|
-
"documentation": {
|
|
481
|
-
"value": "Function definition"
|
|
482
|
-
},
|
|
483
|
-
"insertText": "${1:function_name}() {\n ${0}\n}",
|
|
484
|
-
"insertTextRules": 4,
|
|
485
|
-
"sortText": "03_snip"
|
|
486
|
-
},
|
|
487
|
-
{
|
|
488
|
-
"label": "while_read",
|
|
489
|
-
"kind": 14,
|
|
490
|
-
"detail": "snippet while-read",
|
|
491
|
-
"documentation": {
|
|
492
|
-
"value": "Read file line by line"
|
|
493
|
-
},
|
|
494
|
-
"insertText": "while IFS= read -r ${1:line}; do\n ${0}\ndone < \"${2:file}\"",
|
|
495
|
-
"insertTextRules": 4,
|
|
496
|
-
"sortText": "03_snip"
|
|
497
|
-
},
|
|
498
|
-
{
|
|
499
|
-
"label": "case_stmt",
|
|
500
|
-
"kind": 14,
|
|
501
|
-
"detail": "snippet case",
|
|
502
|
-
"documentation": {
|
|
503
|
-
"value": "Case statement"
|
|
504
|
-
},
|
|
505
|
-
"insertText": "case \"${1:\\$var}\" in\n ${2:pattern})\n ${0}\n ;;\n *)\n ;;\nesac",
|
|
506
|
-
"insertTextRules": 4,
|
|
507
|
-
"sortText": "03_snip"
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
|
|
1
|
+
{
|
|
2
|
+
"language": "shell",
|
|
3
|
+
"completions": [
|
|
4
|
+
{
|
|
5
|
+
"label": "if",
|
|
6
|
+
"kind": 13,
|
|
7
|
+
"detail": "keyword if",
|
|
8
|
+
"documentation": {
|
|
9
|
+
"value": "if keyword"
|
|
10
|
+
},
|
|
11
|
+
"insertText": "if",
|
|
12
|
+
"sortText": "00_kw"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"label": "then",
|
|
16
|
+
"kind": 13,
|
|
17
|
+
"detail": "keyword then",
|
|
18
|
+
"documentation": {
|
|
19
|
+
"value": "then keyword"
|
|
20
|
+
},
|
|
21
|
+
"insertText": "then",
|
|
22
|
+
"sortText": "00_kw"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"label": "else",
|
|
26
|
+
"kind": 13,
|
|
27
|
+
"detail": "keyword else",
|
|
28
|
+
"documentation": {
|
|
29
|
+
"value": "else keyword"
|
|
30
|
+
},
|
|
31
|
+
"insertText": "else",
|
|
32
|
+
"sortText": "00_kw"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"label": "elif",
|
|
36
|
+
"kind": 13,
|
|
37
|
+
"detail": "keyword elif",
|
|
38
|
+
"documentation": {
|
|
39
|
+
"value": "elif keyword"
|
|
40
|
+
},
|
|
41
|
+
"insertText": "elif",
|
|
42
|
+
"sortText": "00_kw"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"label": "fi",
|
|
46
|
+
"kind": 13,
|
|
47
|
+
"detail": "keyword fi",
|
|
48
|
+
"documentation": {
|
|
49
|
+
"value": "fi keyword"
|
|
50
|
+
},
|
|
51
|
+
"insertText": "fi",
|
|
52
|
+
"sortText": "00_kw"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"label": "for",
|
|
56
|
+
"kind": 13,
|
|
57
|
+
"detail": "keyword for",
|
|
58
|
+
"documentation": {
|
|
59
|
+
"value": "for keyword"
|
|
60
|
+
},
|
|
61
|
+
"insertText": "for",
|
|
62
|
+
"sortText": "00_kw"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"label": "in",
|
|
66
|
+
"kind": 13,
|
|
67
|
+
"detail": "keyword in",
|
|
68
|
+
"documentation": {
|
|
69
|
+
"value": "in keyword"
|
|
70
|
+
},
|
|
71
|
+
"insertText": "in",
|
|
72
|
+
"sortText": "00_kw"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"label": "do",
|
|
76
|
+
"kind": 13,
|
|
77
|
+
"detail": "keyword do",
|
|
78
|
+
"documentation": {
|
|
79
|
+
"value": "do keyword"
|
|
80
|
+
},
|
|
81
|
+
"insertText": "do",
|
|
82
|
+
"sortText": "00_kw"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"label": "done",
|
|
86
|
+
"kind": 13,
|
|
87
|
+
"detail": "keyword done",
|
|
88
|
+
"documentation": {
|
|
89
|
+
"value": "done keyword"
|
|
90
|
+
},
|
|
91
|
+
"insertText": "done",
|
|
92
|
+
"sortText": "00_kw"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"label": "while",
|
|
96
|
+
"kind": 13,
|
|
97
|
+
"detail": "keyword while",
|
|
98
|
+
"documentation": {
|
|
99
|
+
"value": "while keyword"
|
|
100
|
+
},
|
|
101
|
+
"insertText": "while",
|
|
102
|
+
"sortText": "00_kw"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"label": "until",
|
|
106
|
+
"kind": 13,
|
|
107
|
+
"detail": "keyword until",
|
|
108
|
+
"documentation": {
|
|
109
|
+
"value": "until keyword"
|
|
110
|
+
},
|
|
111
|
+
"insertText": "until",
|
|
112
|
+
"sortText": "00_kw"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"label": "case",
|
|
116
|
+
"kind": 13,
|
|
117
|
+
"detail": "keyword case",
|
|
118
|
+
"documentation": {
|
|
119
|
+
"value": "case keyword"
|
|
120
|
+
},
|
|
121
|
+
"insertText": "case",
|
|
122
|
+
"sortText": "00_kw"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"label": "esac",
|
|
126
|
+
"kind": 13,
|
|
127
|
+
"detail": "keyword esac",
|
|
128
|
+
"documentation": {
|
|
129
|
+
"value": "esac keyword"
|
|
130
|
+
},
|
|
131
|
+
"insertText": "esac",
|
|
132
|
+
"sortText": "00_kw"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"label": "function",
|
|
136
|
+
"kind": 13,
|
|
137
|
+
"detail": "keyword function",
|
|
138
|
+
"documentation": {
|
|
139
|
+
"value": "function keyword"
|
|
140
|
+
},
|
|
141
|
+
"insertText": "function",
|
|
142
|
+
"sortText": "00_kw"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"label": "return",
|
|
146
|
+
"kind": 13,
|
|
147
|
+
"detail": "keyword return",
|
|
148
|
+
"documentation": {
|
|
149
|
+
"value": "return keyword"
|
|
150
|
+
},
|
|
151
|
+
"insertText": "return",
|
|
152
|
+
"sortText": "00_kw"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"label": "local",
|
|
156
|
+
"kind": 13,
|
|
157
|
+
"detail": "keyword local",
|
|
158
|
+
"documentation": {
|
|
159
|
+
"value": "local keyword"
|
|
160
|
+
},
|
|
161
|
+
"insertText": "local",
|
|
162
|
+
"sortText": "00_kw"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"label": "export",
|
|
166
|
+
"kind": 13,
|
|
167
|
+
"detail": "keyword export",
|
|
168
|
+
"documentation": {
|
|
169
|
+
"value": "export keyword"
|
|
170
|
+
},
|
|
171
|
+
"insertText": "export",
|
|
172
|
+
"sortText": "00_kw"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"label": "readonly",
|
|
176
|
+
"kind": 13,
|
|
177
|
+
"detail": "keyword readonly",
|
|
178
|
+
"documentation": {
|
|
179
|
+
"value": "readonly keyword"
|
|
180
|
+
},
|
|
181
|
+
"insertText": "readonly",
|
|
182
|
+
"sortText": "00_kw"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"label": "declare",
|
|
186
|
+
"kind": 13,
|
|
187
|
+
"detail": "keyword declare",
|
|
188
|
+
"documentation": {
|
|
189
|
+
"value": "declare keyword"
|
|
190
|
+
},
|
|
191
|
+
"insertText": "declare",
|
|
192
|
+
"sortText": "00_kw"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"label": "typeset",
|
|
196
|
+
"kind": 13,
|
|
197
|
+
"detail": "keyword typeset",
|
|
198
|
+
"documentation": {
|
|
199
|
+
"value": "typeset keyword"
|
|
200
|
+
},
|
|
201
|
+
"insertText": "typeset",
|
|
202
|
+
"sortText": "00_kw"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"label": "unset",
|
|
206
|
+
"kind": 13,
|
|
207
|
+
"detail": "keyword unset",
|
|
208
|
+
"documentation": {
|
|
209
|
+
"value": "unset keyword"
|
|
210
|
+
},
|
|
211
|
+
"insertText": "unset",
|
|
212
|
+
"sortText": "00_kw"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"label": "shift",
|
|
216
|
+
"kind": 13,
|
|
217
|
+
"detail": "keyword shift",
|
|
218
|
+
"documentation": {
|
|
219
|
+
"value": "shift keyword"
|
|
220
|
+
},
|
|
221
|
+
"insertText": "shift",
|
|
222
|
+
"sortText": "00_kw"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"label": "break",
|
|
226
|
+
"kind": 13,
|
|
227
|
+
"detail": "keyword break",
|
|
228
|
+
"documentation": {
|
|
229
|
+
"value": "break keyword"
|
|
230
|
+
},
|
|
231
|
+
"insertText": "break",
|
|
232
|
+
"sortText": "00_kw"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"label": "continue",
|
|
236
|
+
"kind": 13,
|
|
237
|
+
"detail": "keyword continue",
|
|
238
|
+
"documentation": {
|
|
239
|
+
"value": "continue keyword"
|
|
240
|
+
},
|
|
241
|
+
"insertText": "continue",
|
|
242
|
+
"sortText": "00_kw"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"label": "exit",
|
|
246
|
+
"kind": 13,
|
|
247
|
+
"detail": "keyword exit",
|
|
248
|
+
"documentation": {
|
|
249
|
+
"value": "exit keyword"
|
|
250
|
+
},
|
|
251
|
+
"insertText": "exit",
|
|
252
|
+
"sortText": "00_kw"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"label": "echo",
|
|
256
|
+
"kind": 1,
|
|
257
|
+
"detail": "builtin echo",
|
|
258
|
+
"documentation": {
|
|
259
|
+
"value": "Built-in: echo"
|
|
260
|
+
},
|
|
261
|
+
"insertText": "echo",
|
|
262
|
+
"sortText": "01_bi"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"label": "printf",
|
|
266
|
+
"kind": 1,
|
|
267
|
+
"detail": "builtin printf",
|
|
268
|
+
"documentation": {
|
|
269
|
+
"value": "Built-in: printf"
|
|
270
|
+
},
|
|
271
|
+
"insertText": "printf",
|
|
272
|
+
"sortText": "01_bi"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"label": "read",
|
|
276
|
+
"kind": 1,
|
|
277
|
+
"detail": "builtin read",
|
|
278
|
+
"documentation": {
|
|
279
|
+
"value": "Built-in: read"
|
|
280
|
+
},
|
|
281
|
+
"insertText": "read",
|
|
282
|
+
"sortText": "01_bi"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"label": "test",
|
|
286
|
+
"kind": 1,
|
|
287
|
+
"detail": "builtin test",
|
|
288
|
+
"documentation": {
|
|
289
|
+
"value": "Built-in: test"
|
|
290
|
+
},
|
|
291
|
+
"insertText": "test",
|
|
292
|
+
"sortText": "01_bi"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"label": "cd",
|
|
296
|
+
"kind": 1,
|
|
297
|
+
"detail": "builtin cd",
|
|
298
|
+
"documentation": {
|
|
299
|
+
"value": "Built-in: cd"
|
|
300
|
+
},
|
|
301
|
+
"insertText": "cd",
|
|
302
|
+
"sortText": "01_bi"
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"label": "pwd",
|
|
306
|
+
"kind": 1,
|
|
307
|
+
"detail": "builtin pwd",
|
|
308
|
+
"documentation": {
|
|
309
|
+
"value": "Built-in: pwd"
|
|
310
|
+
},
|
|
311
|
+
"insertText": "pwd",
|
|
312
|
+
"sortText": "01_bi"
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"label": "pushd",
|
|
316
|
+
"kind": 1,
|
|
317
|
+
"detail": "builtin pushd",
|
|
318
|
+
"documentation": {
|
|
319
|
+
"value": "Built-in: pushd"
|
|
320
|
+
},
|
|
321
|
+
"insertText": "pushd",
|
|
322
|
+
"sortText": "01_bi"
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
"label": "popd",
|
|
326
|
+
"kind": 1,
|
|
327
|
+
"detail": "builtin popd",
|
|
328
|
+
"documentation": {
|
|
329
|
+
"value": "Built-in: popd"
|
|
330
|
+
},
|
|
331
|
+
"insertText": "popd",
|
|
332
|
+
"sortText": "01_bi"
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"label": "dirs",
|
|
336
|
+
"kind": 1,
|
|
337
|
+
"detail": "builtin dirs",
|
|
338
|
+
"documentation": {
|
|
339
|
+
"value": "Built-in: dirs"
|
|
340
|
+
},
|
|
341
|
+
"insertText": "dirs",
|
|
342
|
+
"sortText": "01_bi"
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"label": "let",
|
|
346
|
+
"kind": 1,
|
|
347
|
+
"detail": "builtin let",
|
|
348
|
+
"documentation": {
|
|
349
|
+
"value": "Built-in: let"
|
|
350
|
+
},
|
|
351
|
+
"insertText": "let",
|
|
352
|
+
"sortText": "01_bi"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"label": "expr",
|
|
356
|
+
"kind": 1,
|
|
357
|
+
"detail": "builtin expr",
|
|
358
|
+
"documentation": {
|
|
359
|
+
"value": "Built-in: expr"
|
|
360
|
+
},
|
|
361
|
+
"insertText": "expr",
|
|
362
|
+
"sortText": "01_bi"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"label": "bc",
|
|
366
|
+
"kind": 1,
|
|
367
|
+
"detail": "builtin bc",
|
|
368
|
+
"documentation": {
|
|
369
|
+
"value": "Built-in: bc"
|
|
370
|
+
},
|
|
371
|
+
"insertText": "bc",
|
|
372
|
+
"sortText": "01_bi"
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"label": "true",
|
|
376
|
+
"kind": 1,
|
|
377
|
+
"detail": "builtin true",
|
|
378
|
+
"documentation": {
|
|
379
|
+
"value": "Built-in: true"
|
|
380
|
+
},
|
|
381
|
+
"insertText": "true",
|
|
382
|
+
"sortText": "01_bi"
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
"label": "false",
|
|
386
|
+
"kind": 1,
|
|
387
|
+
"detail": "builtin false",
|
|
388
|
+
"documentation": {
|
|
389
|
+
"value": "Built-in: false"
|
|
390
|
+
},
|
|
391
|
+
"insertText": "false",
|
|
392
|
+
"sortText": "01_bi"
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
"label": "command",
|
|
396
|
+
"kind": 1,
|
|
397
|
+
"detail": "builtin command",
|
|
398
|
+
"documentation": {
|
|
399
|
+
"value": "Built-in: command"
|
|
400
|
+
},
|
|
401
|
+
"insertText": "command",
|
|
402
|
+
"sortText": "01_bi"
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
"label": "builtin",
|
|
406
|
+
"kind": 1,
|
|
407
|
+
"detail": "builtin builtin",
|
|
408
|
+
"documentation": {
|
|
409
|
+
"value": "Built-in: builtin"
|
|
410
|
+
},
|
|
411
|
+
"insertText": "builtin",
|
|
412
|
+
"sortText": "01_bi"
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
"label": "type",
|
|
416
|
+
"kind": 1,
|
|
417
|
+
"detail": "builtin type",
|
|
418
|
+
"documentation": {
|
|
419
|
+
"value": "Built-in: type"
|
|
420
|
+
},
|
|
421
|
+
"insertText": "type",
|
|
422
|
+
"sortText": "01_bi"
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
"label": "which",
|
|
426
|
+
"kind": 1,
|
|
427
|
+
"detail": "builtin which",
|
|
428
|
+
"documentation": {
|
|
429
|
+
"value": "Built-in: which"
|
|
430
|
+
},
|
|
431
|
+
"insertText": "which",
|
|
432
|
+
"sortText": "01_bi"
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
"label": "hash",
|
|
436
|
+
"kind": 1,
|
|
437
|
+
"detail": "builtin hash",
|
|
438
|
+
"documentation": {
|
|
439
|
+
"value": "Built-in: hash"
|
|
440
|
+
},
|
|
441
|
+
"insertText": "hash",
|
|
442
|
+
"sortText": "01_bi"
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"label": "help",
|
|
446
|
+
"kind": 1,
|
|
447
|
+
"detail": "builtin help",
|
|
448
|
+
"documentation": {
|
|
449
|
+
"value": "Built-in: help"
|
|
450
|
+
},
|
|
451
|
+
"insertText": "help",
|
|
452
|
+
"sortText": "01_bi"
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"label": "if_block",
|
|
456
|
+
"kind": 14,
|
|
457
|
+
"detail": "snippet if",
|
|
458
|
+
"documentation": {
|
|
459
|
+
"value": "If statement"
|
|
460
|
+
},
|
|
461
|
+
"insertText": "if [[ ${1:condition} ]]; then\n ${0}\nfi",
|
|
462
|
+
"insertTextRules": 4,
|
|
463
|
+
"sortText": "03_snip"
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
"label": "for_loop",
|
|
467
|
+
"kind": 14,
|
|
468
|
+
"detail": "snippet for",
|
|
469
|
+
"documentation": {
|
|
470
|
+
"value": "For loop"
|
|
471
|
+
},
|
|
472
|
+
"insertText": "for ${1:item} in ${2:list}; do\n ${0}\ndone",
|
|
473
|
+
"insertTextRules": 4,
|
|
474
|
+
"sortText": "03_snip"
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
"label": "function_def",
|
|
478
|
+
"kind": 14,
|
|
479
|
+
"detail": "snippet function",
|
|
480
|
+
"documentation": {
|
|
481
|
+
"value": "Function definition"
|
|
482
|
+
},
|
|
483
|
+
"insertText": "${1:function_name}() {\n ${0}\n}",
|
|
484
|
+
"insertTextRules": 4,
|
|
485
|
+
"sortText": "03_snip"
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
"label": "while_read",
|
|
489
|
+
"kind": 14,
|
|
490
|
+
"detail": "snippet while-read",
|
|
491
|
+
"documentation": {
|
|
492
|
+
"value": "Read file line by line"
|
|
493
|
+
},
|
|
494
|
+
"insertText": "while IFS= read -r ${1:line}; do\n ${0}\ndone < \"${2:file}\"",
|
|
495
|
+
"insertTextRules": 4,
|
|
496
|
+
"sortText": "03_snip"
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
"label": "case_stmt",
|
|
500
|
+
"kind": 14,
|
|
501
|
+
"detail": "snippet case",
|
|
502
|
+
"documentation": {
|
|
503
|
+
"value": "Case statement"
|
|
504
|
+
},
|
|
505
|
+
"insertText": "case \"${1:\\$var}\" in\n ${2:pattern})\n ${0}\n ;;\n *)\n ;;\nesac",
|
|
506
|
+
"insertTextRules": 4,
|
|
507
|
+
"sortText": "03_snip"
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
"label": "source",
|
|
511
|
+
"kind": 1,
|
|
512
|
+
"detail": "Execute commands from a file in the current shell",
|
|
513
|
+
"documentation": {
|
|
514
|
+
"value": "Read and execute commands from a file in the current shell environment.\n\n```bash\nsource ~/.bashrc\nsource ./config.sh\n. ./env.sh # shorthand for source\n```"
|
|
515
|
+
},
|
|
516
|
+
"insertText": "source ${1:file}",
|
|
517
|
+
"insertTextRules": 4,
|
|
518
|
+
"sortText": "00_source"
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
"label": "alias",
|
|
522
|
+
"kind": 1,
|
|
523
|
+
"detail": "Define or display aliases",
|
|
524
|
+
"documentation": {
|
|
525
|
+
"value": "Create a shortcut name for a command.\n\n```bash\nalias ll='ls -la'\nalias gs='git status'\nalias # list all aliases\nalias ll # show specific alias\n```"
|
|
526
|
+
},
|
|
527
|
+
"insertText": "alias ${1:name}='${2:command}'",
|
|
528
|
+
"insertTextRules": 4,
|
|
529
|
+
"sortText": "00_alias"
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
"label": "unalias",
|
|
533
|
+
"kind": 1,
|
|
534
|
+
"detail": "Remove alias definitions",
|
|
535
|
+
"documentation": {
|
|
536
|
+
"value": "Remove alias definitions.\n\n```bash\nunalias ll\nunalias -a # remove all aliases\n```"
|
|
537
|
+
},
|
|
538
|
+
"insertText": "unalias ${1:name}",
|
|
539
|
+
"insertTextRules": 4,
|
|
540
|
+
"sortText": "00_unalias"
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
"label": "eval",
|
|
544
|
+
"kind": 1,
|
|
545
|
+
"detail": "Evaluate arguments as a shell command",
|
|
546
|
+
"documentation": {
|
|
547
|
+
"value": "Concatenate arguments and execute them as a shell command.\n\n```bash\ncmd=\"ls -la\"\neval \"$cmd\"\neval \"echo \\$HOME\"\n```"
|
|
548
|
+
},
|
|
549
|
+
"insertText": "eval \"${1:command}\"",
|
|
550
|
+
"insertTextRules": 4,
|
|
551
|
+
"sortText": "00_eval"
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"label": "exec",
|
|
555
|
+
"kind": 1,
|
|
556
|
+
"detail": "Replace the shell with a command",
|
|
557
|
+
"documentation": {
|
|
558
|
+
"value": "Replace the shell process with the specified command, or redirect file descriptors.\n\n```bash\nexec /bin/zsh\nexec > output.log 2>&1 # redirect all output\nexec 3< input.txt # open fd 3 for reading\n```"
|
|
559
|
+
},
|
|
560
|
+
"insertText": "exec ${1:command}",
|
|
561
|
+
"insertTextRules": 4,
|
|
562
|
+
"sortText": "00_exec"
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
"label": "trap",
|
|
566
|
+
"kind": 1,
|
|
567
|
+
"detail": "Trap signals and events",
|
|
568
|
+
"documentation": {
|
|
569
|
+
"value": "Execute a command when the shell receives a signal.\n\n```bash\ntrap 'echo Interrupted' INT\ntrap 'rm -f /tmp/tmpfile; exit' EXIT\ntrap '' SIGTERM # ignore SIGTERM\ntrap - INT # reset to default\n```"
|
|
570
|
+
},
|
|
571
|
+
"insertText": "trap '${1:command}' ${2:SIGNAL}",
|
|
572
|
+
"insertTextRules": 4,
|
|
573
|
+
"sortText": "00_trap"
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
"label": "set",
|
|
577
|
+
"kind": 1,
|
|
578
|
+
"detail": "Set or unset shell options",
|
|
579
|
+
"documentation": {
|
|
580
|
+
"value": "Set shell options and positional parameters.\n\n```bash\nset -e # exit on error\nset -u # error on unset variables\nset -o pipefail # fail on pipe errors\nset -x # print commands before execution\nset -- \"a\" \"b\" # set positional params\n```"
|
|
581
|
+
},
|
|
582
|
+
"insertText": "set -${1:euo} pipefail",
|
|
583
|
+
"insertTextRules": 4,
|
|
584
|
+
"sortText": "00_set"
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
"label": "select",
|
|
588
|
+
"kind": 14,
|
|
589
|
+
"detail": "Select loop for menus",
|
|
590
|
+
"documentation": {
|
|
591
|
+
"value": "Create a numbered menu for user selection.\n\n```bash\nselect opt in \"Option 1\" \"Option 2\" \"Quit\"; do\n case $opt in\n \"Option 1\") echo \"Selected 1\" ;;\n \"Option 2\") echo \"Selected 2\" ;;\n \"Quit\") break ;;\n *) echo \"Invalid\" ;;\n esac\ndone\n```"
|
|
592
|
+
},
|
|
593
|
+
"insertText": "select ${1:opt} in ${2:options}; do\n\t${3:commands}\ndone",
|
|
594
|
+
"insertTextRules": 4,
|
|
595
|
+
"sortText": "01_select"
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
"label": "grep",
|
|
599
|
+
"kind": 1,
|
|
600
|
+
"detail": "Search text using patterns",
|
|
601
|
+
"documentation": {
|
|
602
|
+
"value": "Search for lines matching a pattern.\n\n```bash\ngrep \"pattern\" file.txt\ngrep -r \"TODO\" ./src\ngrep -i -n \"error\" log.txt\ngrep -E \"^[0-9]+\" data.txt\ngrep -v \"exclude\" file.txt\ngrep -c \"count\" file.txt\n```"
|
|
603
|
+
},
|
|
604
|
+
"insertText": "grep ${1:-r} \"${2:pattern}\" ${3:file}",
|
|
605
|
+
"insertTextRules": 4,
|
|
606
|
+
"sortText": "02_grep"
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
"label": "sed",
|
|
610
|
+
"kind": 1,
|
|
611
|
+
"detail": "Stream editor for text transformation",
|
|
612
|
+
"documentation": {
|
|
613
|
+
"value": "Transform text using patterns and commands.\n\n```bash\nsed 's/old/new/g' file.txt\nsed -i 's/old/new/g' file.txt # in-place edit\nsed -n '10,20p' file.txt # print lines 10-20\nsed '/pattern/d' file.txt # delete matching lines\nsed '1i\\Header line' file.txt # insert at line 1\n```"
|
|
614
|
+
},
|
|
615
|
+
"insertText": "sed '${1:s/old/new/g}' ${2:file}",
|
|
616
|
+
"insertTextRules": 4,
|
|
617
|
+
"sortText": "02_sed"
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
"label": "awk",
|
|
621
|
+
"kind": 1,
|
|
622
|
+
"detail": "Pattern scanning and processing",
|
|
623
|
+
"documentation": {
|
|
624
|
+
"value": "Process and analyze text files.\n\n```bash\nawk '{print $1}' file.txt\nawk -F: '{print $1, $3}' /etc/passwd\nawk '/pattern/ {print $0}' file.txt\nawk 'NR==1 {print}' file.txt\nawk '{sum += $1} END {print sum}' data.txt\n```"
|
|
625
|
+
},
|
|
626
|
+
"insertText": "awk '${1:{print \\$0}}' ${2:file}",
|
|
627
|
+
"insertTextRules": 4,
|
|
628
|
+
"sortText": "02_awk"
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
"label": "find",
|
|
632
|
+
"kind": 1,
|
|
633
|
+
"detail": "Search for files in a directory hierarchy",
|
|
634
|
+
"documentation": {
|
|
635
|
+
"value": "Find files and directories matching criteria.\n\n```bash\nfind . -name \"*.txt\"\nfind . -type f -name \"*.log\" -mtime -7\nfind /path -size +100M\nfind . -name \"*.tmp\" -delete\nfind . -type f -exec chmod 644 {} \\;\nfind . -name \"*.py\" | xargs grep \"import\"\n```"
|
|
636
|
+
},
|
|
637
|
+
"insertText": "find ${1:.} -name \"${2:pattern}\"",
|
|
638
|
+
"insertTextRules": 4,
|
|
639
|
+
"sortText": "02_find"
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
"label": "xargs",
|
|
643
|
+
"kind": 1,
|
|
644
|
+
"detail": "Build and execute commands from stdin",
|
|
645
|
+
"documentation": {
|
|
646
|
+
"value": "Construct argument lists and execute commands.\n\n```bash\nfind . -name \"*.txt\" | xargs grep \"pattern\"\necho \"a b c\" | xargs -n1 echo\nfind . -name \"*.bak\" -print0 | xargs -0 rm\ncat urls.txt | xargs -P 4 -I {} curl {}\n```"
|
|
647
|
+
},
|
|
648
|
+
"insertText": "xargs ${1:command}",
|
|
649
|
+
"insertTextRules": 4,
|
|
650
|
+
"sortText": "02_xargs"
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
"label": "sort",
|
|
654
|
+
"kind": 1,
|
|
655
|
+
"detail": "Sort lines of text",
|
|
656
|
+
"documentation": {
|
|
657
|
+
"value": "Sort lines in text files.\n\n```bash\nsort file.txt\nsort -n numbers.txt # numeric sort\nsort -r file.txt # reverse sort\nsort -u file.txt # unique sort\nsort -t: -k3 -n /etc/passwd\n```"
|
|
658
|
+
},
|
|
659
|
+
"insertText": "sort ${1:file}",
|
|
660
|
+
"insertTextRules": 4,
|
|
661
|
+
"sortText": "02_sort"
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
"label": "uniq",
|
|
665
|
+
"kind": 1,
|
|
666
|
+
"detail": "Report or omit repeated lines",
|
|
667
|
+
"documentation": {
|
|
668
|
+
"value": "Filter adjacent matching lines.\n\n```bash\nsort file.txt | uniq\nsort file.txt | uniq -c # count occurrences\nsort file.txt | uniq -d # only duplicates\nsort file.txt | uniq -u # only unique\n```"
|
|
669
|
+
},
|
|
670
|
+
"insertText": "uniq ${1:file}",
|
|
671
|
+
"insertTextRules": 4,
|
|
672
|
+
"sortText": "02_uniq"
|
|
673
|
+
},
|
|
674
|
+
{
|
|
675
|
+
"label": "wc",
|
|
676
|
+
"kind": 1,
|
|
677
|
+
"detail": "Word, line, character, and byte count",
|
|
678
|
+
"documentation": {
|
|
679
|
+
"value": "Count lines, words, and characters.\n\n```bash\nwc file.txt # lines, words, chars\nwc -l file.txt # line count only\nwc -w file.txt # word count only\nwc -c file.txt # byte count\nfind . -name '*.py' | wc -l\n```"
|
|
680
|
+
},
|
|
681
|
+
"insertText": "wc -${1:l} ${2:file}",
|
|
682
|
+
"insertTextRules": 4,
|
|
683
|
+
"sortText": "02_wc"
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
"label": "cut",
|
|
687
|
+
"kind": 1,
|
|
688
|
+
"detail": "Remove sections from lines",
|
|
689
|
+
"documentation": {
|
|
690
|
+
"value": "Extract columns or fields from text.\n\n```bash\ncut -d: -f1 /etc/passwd # first field, colon delim\ncut -c1-10 file.txt # characters 1-10\ncut -f2,4 -d'\\t' data.tsv # fields 2 and 4\n```"
|
|
691
|
+
},
|
|
692
|
+
"insertText": "cut -d'${1:delimiter}' -f${2:fields} ${3:file}",
|
|
693
|
+
"insertTextRules": 4,
|
|
694
|
+
"sortText": "02_cut"
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
"label": "tr",
|
|
698
|
+
"kind": 1,
|
|
699
|
+
"detail": "Translate or delete characters",
|
|
700
|
+
"documentation": {
|
|
701
|
+
"value": "Translate, squeeze, or delete characters.\n\n```bash\necho \"HELLO\" | tr 'A-Z' 'a-z' # to lowercase\necho \"hello\" | tr 'a-z' 'A-Z' # to uppercase\ntr -d '\\n' < file.txt # delete newlines\ntr -s ' ' < file.txt # squeeze spaces\n```"
|
|
702
|
+
},
|
|
703
|
+
"insertText": "tr '${1:set1}' '${2:set2}'",
|
|
704
|
+
"insertTextRules": 4,
|
|
705
|
+
"sortText": "02_tr"
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
"label": "tee",
|
|
709
|
+
"kind": 1,
|
|
710
|
+
"detail": "Read from stdin and write to stdout and files",
|
|
711
|
+
"documentation": {
|
|
712
|
+
"value": "Duplicate output to both stdout and files.\n\n```bash\ncommand | tee output.log\ncommand | tee -a output.log # append\ncommand | tee file1 file2 # multiple files\n```"
|
|
713
|
+
},
|
|
714
|
+
"insertText": "tee ${1:file}",
|
|
715
|
+
"insertTextRules": 4,
|
|
716
|
+
"sortText": "02_tee"
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
"label": "head",
|
|
720
|
+
"kind": 1,
|
|
721
|
+
"detail": "Output the first part of files",
|
|
722
|
+
"documentation": {
|
|
723
|
+
"value": "Display the first lines of a file.\n\n```bash\nhead file.txt # first 10 lines\nhead -n 20 file.txt # first 20 lines\nhead -c 100 file.txt # first 100 bytes\n```"
|
|
724
|
+
},
|
|
725
|
+
"insertText": "head -n ${1:10} ${2:file}",
|
|
726
|
+
"insertTextRules": 4,
|
|
727
|
+
"sortText": "02_head"
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
"label": "tail",
|
|
731
|
+
"kind": 1,
|
|
732
|
+
"detail": "Output the last part of files",
|
|
733
|
+
"documentation": {
|
|
734
|
+
"value": "Display the last lines of a file.\n\n```bash\ntail file.txt # last 10 lines\ntail -n 20 file.txt # last 20 lines\ntail -f /var/log/syslog # follow log in real time\ntail -n +5 file.txt # from line 5 onwards\n```"
|
|
735
|
+
},
|
|
736
|
+
"insertText": "tail -n ${1:10} ${2:file}",
|
|
737
|
+
"insertTextRules": 4,
|
|
738
|
+
"sortText": "02_tail"
|
|
739
|
+
},
|
|
740
|
+
{
|
|
741
|
+
"label": "cat",
|
|
742
|
+
"kind": 1,
|
|
743
|
+
"detail": "Concatenate and display files",
|
|
744
|
+
"documentation": {
|
|
745
|
+
"value": "Concatenate files and print to stdout.\n\n```bash\ncat file.txt\ncat file1.txt file2.txt > combined.txt\ncat -n file.txt # with line numbers\ncat -A file.txt # show all (tabs, EOL)\n```"
|
|
746
|
+
},
|
|
747
|
+
"insertText": "cat ${1:file}",
|
|
748
|
+
"insertTextRules": 4,
|
|
749
|
+
"sortText": "02_cat"
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
"label": "less",
|
|
753
|
+
"kind": 1,
|
|
754
|
+
"detail": "View file contents with paging",
|
|
755
|
+
"documentation": {
|
|
756
|
+
"value": "View file contents page by page.\n\n```bash\nless file.txt\nless -N file.txt # with line numbers\nless +F /var/log/syslog # follow mode\n```"
|
|
757
|
+
},
|
|
758
|
+
"insertText": "less ${1:file}",
|
|
759
|
+
"insertTextRules": 4,
|
|
760
|
+
"sortText": "02_less"
|
|
761
|
+
},
|
|
762
|
+
{
|
|
763
|
+
"label": "diff",
|
|
764
|
+
"kind": 1,
|
|
765
|
+
"detail": "Compare files line by line",
|
|
766
|
+
"documentation": {
|
|
767
|
+
"value": "Compare files and show differences.\n\n```bash\ndiff file1.txt file2.txt\ndiff -u old.txt new.txt # unified format\ndiff -r dir1/ dir2/ # recursive compare\ndiff --color file1 file2\n```"
|
|
768
|
+
},
|
|
769
|
+
"insertText": "diff ${1:file1} ${2:file2}",
|
|
770
|
+
"insertTextRules": 4,
|
|
771
|
+
"sortText": "02_diff"
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
"label": "chmod",
|
|
775
|
+
"kind": 1,
|
|
776
|
+
"detail": "Change file permissions",
|
|
777
|
+
"documentation": {
|
|
778
|
+
"value": "Change file mode bits.\n\n```bash\nchmod +x script.sh\nchmod 755 script.sh\nchmod -R 644 ./dir\nchmod u+rw,go-w file.txt\n```"
|
|
779
|
+
},
|
|
780
|
+
"insertText": "chmod ${1:755} ${2:file}",
|
|
781
|
+
"insertTextRules": 4,
|
|
782
|
+
"sortText": "02_chmod"
|
|
783
|
+
},
|
|
784
|
+
{
|
|
785
|
+
"label": "chown",
|
|
786
|
+
"kind": 1,
|
|
787
|
+
"detail": "Change file owner and group",
|
|
788
|
+
"documentation": {
|
|
789
|
+
"value": "Change file ownership.\n\n```bash\nchown user:group file.txt\nchown -R www-data:www-data /var/www\nchown user file.txt\n```"
|
|
790
|
+
},
|
|
791
|
+
"insertText": "chown ${1:user}:${2:group} ${3:file}",
|
|
792
|
+
"insertTextRules": 4,
|
|
793
|
+
"sortText": "02_chown"
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
"label": "mkdir",
|
|
797
|
+
"kind": 1,
|
|
798
|
+
"detail": "Create directories",
|
|
799
|
+
"documentation": {
|
|
800
|
+
"value": "Create one or more directories.\n\n```bash\nmkdir mydir\nmkdir -p path/to/nested/dir\nmkdir -m 755 secure_dir\n```"
|
|
801
|
+
},
|
|
802
|
+
"insertText": "mkdir -p ${1:directory}",
|
|
803
|
+
"insertTextRules": 4,
|
|
804
|
+
"sortText": "02_mkdir"
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
"label": "rmdir",
|
|
808
|
+
"kind": 1,
|
|
809
|
+
"detail": "Remove empty directories",
|
|
810
|
+
"documentation": {
|
|
811
|
+
"value": "Remove empty directories.\n\n```bash\nrmdir empty_dir\nrmdir -p path/to/empty_dirs\n```"
|
|
812
|
+
},
|
|
813
|
+
"insertText": "rmdir ${1:directory}",
|
|
814
|
+
"insertTextRules": 4,
|
|
815
|
+
"sortText": "02_rmdir"
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
"label": "cp",
|
|
819
|
+
"kind": 1,
|
|
820
|
+
"detail": "Copy files and directories",
|
|
821
|
+
"documentation": {
|
|
822
|
+
"value": "Copy files and directories.\n\n```bash\ncp source.txt dest.txt\ncp -r source_dir/ dest_dir/\ncp -a source/ dest/ # preserve attributes\ncp -i file.txt backup/ # interactive (prompt)\n```"
|
|
823
|
+
},
|
|
824
|
+
"insertText": "cp ${1:source} ${2:destination}",
|
|
825
|
+
"insertTextRules": 4,
|
|
826
|
+
"sortText": "02_cp"
|
|
827
|
+
},
|
|
828
|
+
{
|
|
829
|
+
"label": "mv",
|
|
830
|
+
"kind": 1,
|
|
831
|
+
"detail": "Move or rename files",
|
|
832
|
+
"documentation": {
|
|
833
|
+
"value": "Move or rename files and directories.\n\n```bash\nmv old.txt new.txt\nmv file.txt /path/to/dest/\nmv -i source dest # interactive\nmv -n source dest # no overwrite\n```"
|
|
834
|
+
},
|
|
835
|
+
"insertText": "mv ${1:source} ${2:destination}",
|
|
836
|
+
"insertTextRules": 4,
|
|
837
|
+
"sortText": "02_mv"
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
"label": "rm",
|
|
841
|
+
"kind": 1,
|
|
842
|
+
"detail": "Remove files or directories",
|
|
843
|
+
"documentation": {
|
|
844
|
+
"value": "Remove files or directories.\n\n```bash\nrm file.txt\nrm -f file.txt # force, no prompt\nrm -r directory/ # recursive\nrm -rf directory/ # force recursive\nrm -i file.txt # interactive\n```"
|
|
845
|
+
},
|
|
846
|
+
"insertText": "rm ${1:file}",
|
|
847
|
+
"insertTextRules": 4,
|
|
848
|
+
"sortText": "02_rm"
|
|
849
|
+
},
|
|
850
|
+
{
|
|
851
|
+
"label": "ln",
|
|
852
|
+
"kind": 1,
|
|
853
|
+
"detail": "Create links between files",
|
|
854
|
+
"documentation": {
|
|
855
|
+
"value": "Create hard and symbolic links.\n\n```bash\nln -s /path/to/target link_name # symbolic link\nln target link_name # hard link\nln -sf /new/target link_name # force symbolic\n```"
|
|
856
|
+
},
|
|
857
|
+
"insertText": "ln -s ${1:target} ${2:link_name}",
|
|
858
|
+
"insertTextRules": 4,
|
|
859
|
+
"sortText": "02_ln"
|
|
860
|
+
},
|
|
861
|
+
{
|
|
862
|
+
"label": "touch",
|
|
863
|
+
"kind": 1,
|
|
864
|
+
"detail": "Create file or update timestamps",
|
|
865
|
+
"documentation": {
|
|
866
|
+
"value": "Create an empty file or update file timestamps.\n\n```bash\ntouch newfile.txt\ntouch -t 202301010000 file.txt # set specific time\ntouch -r ref_file target_file # copy timestamp\n```"
|
|
867
|
+
},
|
|
868
|
+
"insertText": "touch ${1:file}",
|
|
869
|
+
"insertTextRules": 4,
|
|
870
|
+
"sortText": "02_touch"
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
"label": "tar",
|
|
874
|
+
"kind": 1,
|
|
875
|
+
"detail": "Archive files",
|
|
876
|
+
"documentation": {
|
|
877
|
+
"value": "Create and extract archive files.\n\n```bash\ntar czf archive.tar.gz dir/ # create gzipped\ntar xzf archive.tar.gz # extract gzipped\ntar xjf archive.tar.bz2 # extract bzip2\ntar tf archive.tar # list contents\ntar czf backup.tar.gz --exclude='*.log' dir/\n```"
|
|
878
|
+
},
|
|
879
|
+
"insertText": "tar ${1:czf} ${2:archive.tar.gz} ${3:directory}",
|
|
880
|
+
"insertTextRules": 4,
|
|
881
|
+
"sortText": "02_tar"
|
|
882
|
+
},
|
|
883
|
+
{
|
|
884
|
+
"label": "gzip",
|
|
885
|
+
"kind": 1,
|
|
886
|
+
"detail": "Compress or decompress files",
|
|
887
|
+
"documentation": {
|
|
888
|
+
"value": "Compress or expand files.\n\n```bash\ngzip file.txt # compress (replaces file)\ngzip -d file.txt.gz # decompress\ngzip -k file.txt # keep original\ngzip -9 file.txt # max compression\n```"
|
|
889
|
+
},
|
|
890
|
+
"insertText": "gzip ${1:file}",
|
|
891
|
+
"insertTextRules": 4,
|
|
892
|
+
"sortText": "02_gzip"
|
|
893
|
+
},
|
|
894
|
+
{
|
|
895
|
+
"label": "curl",
|
|
896
|
+
"kind": 1,
|
|
897
|
+
"detail": "Transfer data from or to a server",
|
|
898
|
+
"documentation": {
|
|
899
|
+
"value": "Make HTTP requests and transfer data.\n\n```bash\ncurl https://example.com\ncurl -o file.txt https://example.com/file\ncurl -X POST -d '{\"key\":\"val\"}' -H 'Content-Type: application/json' url\ncurl -sS https://example.com | jq .\ncurl -L -O https://example.com/download.tar.gz\n```"
|
|
900
|
+
},
|
|
901
|
+
"insertText": "curl ${1:-sS} ${2:url}",
|
|
902
|
+
"insertTextRules": 4,
|
|
903
|
+
"sortText": "02_curl"
|
|
904
|
+
},
|
|
905
|
+
{
|
|
906
|
+
"label": "wget",
|
|
907
|
+
"kind": 1,
|
|
908
|
+
"detail": "Download files from the web",
|
|
909
|
+
"documentation": {
|
|
910
|
+
"value": "Non-interactive network downloader.\n\n```bash\nwget https://example.com/file.tar.gz\nwget -O output.html https://example.com\nwget -q -O- https://example.com\nwget -r -np https://example.com/dir/\n```"
|
|
911
|
+
},
|
|
912
|
+
"insertText": "wget ${1:url}",
|
|
913
|
+
"insertTextRules": 4,
|
|
914
|
+
"sortText": "02_wget"
|
|
915
|
+
},
|
|
916
|
+
{
|
|
917
|
+
"label": "[[ -f file ]]",
|
|
918
|
+
"kind": 15,
|
|
919
|
+
"detail": "Test if file exists and is regular file",
|
|
920
|
+
"documentation": {
|
|
921
|
+
"value": "Conditional test operators:\n\n```bash\n[[ -f file ]] # file exists and is regular file\n[[ -d dir ]] # directory exists\n[[ -e path ]] # path exists (any type)\n[[ -r file ]] # file is readable\n[[ -w file ]] # file is writable\n[[ -x file ]] # file is executable\n[[ -s file ]] # file exists and is non-empty\n[[ -L file ]] # file is symbolic link\n```"
|
|
922
|
+
},
|
|
923
|
+
"insertText": "[[ -f \"${1:file}\" ]]",
|
|
924
|
+
"insertTextRules": 4,
|
|
925
|
+
"sortText": "03_test_f"
|
|
926
|
+
},
|
|
927
|
+
{
|
|
928
|
+
"label": "[[ -d dir ]]",
|
|
929
|
+
"kind": 15,
|
|
930
|
+
"detail": "Test if directory exists",
|
|
931
|
+
"documentation": {
|
|
932
|
+
"value": "Test if path is a directory.\n\n```bash\nif [[ -d \"$dir\" ]]; then\n echo \"Directory exists\"\nfi\n```"
|
|
933
|
+
},
|
|
934
|
+
"insertText": "[[ -d \"${1:directory}\" ]]",
|
|
935
|
+
"insertTextRules": 4,
|
|
936
|
+
"sortText": "03_test_d"
|
|
937
|
+
},
|
|
938
|
+
{
|
|
939
|
+
"label": "[[ -e path ]]",
|
|
940
|
+
"kind": 15,
|
|
941
|
+
"detail": "Test if path exists",
|
|
942
|
+
"documentation": {
|
|
943
|
+
"value": "Test if a file or directory exists.\n\n```bash\nif [[ -e \"$path\" ]]; then\n echo \"Path exists\"\nfi\n```"
|
|
944
|
+
},
|
|
945
|
+
"insertText": "[[ -e \"${1:path}\" ]]",
|
|
946
|
+
"insertTextRules": 4,
|
|
947
|
+
"sortText": "03_test_e"
|
|
948
|
+
},
|
|
949
|
+
{
|
|
950
|
+
"label": "[[ -z string ]]",
|
|
951
|
+
"kind": 15,
|
|
952
|
+
"detail": "Test if string is empty",
|
|
953
|
+
"documentation": {
|
|
954
|
+
"value": "Test if a string has zero length.\n\n```bash\nif [[ -z \"$var\" ]]; then\n echo \"Variable is empty\"\nfi\n```"
|
|
955
|
+
},
|
|
956
|
+
"insertText": "[[ -z \"${1:string}\" ]]",
|
|
957
|
+
"insertTextRules": 4,
|
|
958
|
+
"sortText": "03_test_z"
|
|
959
|
+
},
|
|
960
|
+
{
|
|
961
|
+
"label": "[[ -n string ]]",
|
|
962
|
+
"kind": 15,
|
|
963
|
+
"detail": "Test if string is non-empty",
|
|
964
|
+
"documentation": {
|
|
965
|
+
"value": "Test if a string has non-zero length.\n\n```bash\nif [[ -n \"$var\" ]]; then\n echo \"Variable is not empty\"\nfi\n```"
|
|
966
|
+
},
|
|
967
|
+
"insertText": "[[ -n \"${1:string}\" ]]",
|
|
968
|
+
"insertTextRules": 4,
|
|
969
|
+
"sortText": "03_test_n"
|
|
970
|
+
},
|
|
971
|
+
{
|
|
972
|
+
"label": "[[ a -eq b ]]",
|
|
973
|
+
"kind": 15,
|
|
974
|
+
"detail": "Integer comparison operators",
|
|
975
|
+
"documentation": {
|
|
976
|
+
"value": "Integer comparison operators:\n\n```bash\n[[ $a -eq $b ]] # equal\n[[ $a -ne $b ]] # not equal\n[[ $a -gt $b ]] # greater than\n[[ $a -lt $b ]] # less than\n[[ $a -ge $b ]] # greater or equal\n[[ $a -le $b ]] # less or equal\n```"
|
|
977
|
+
},
|
|
978
|
+
"insertText": "[[ ${1:a} -${2:eq} ${3:b} ]]",
|
|
979
|
+
"insertTextRules": 4,
|
|
980
|
+
"sortText": "03_test_eq"
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
"label": "${var:-default}",
|
|
984
|
+
"kind": 5,
|
|
985
|
+
"detail": "Variable with default value",
|
|
986
|
+
"documentation": {
|
|
987
|
+
"value": "Use default value if variable is unset or null.\n\n```bash\nname=${name:-\"World\"}\necho \"Hello, ${user:-guest}\"\n```"
|
|
988
|
+
},
|
|
989
|
+
"insertText": "${${1:var}:-${2:default}}",
|
|
990
|
+
"insertTextRules": 4,
|
|
991
|
+
"sortText": "04_var_default"
|
|
992
|
+
},
|
|
993
|
+
{
|
|
994
|
+
"label": "${var:+alternate}",
|
|
995
|
+
"kind": 5,
|
|
996
|
+
"detail": "Variable with alternate value",
|
|
997
|
+
"documentation": {
|
|
998
|
+
"value": "Use alternate value if variable IS set and non-null.\n\n```bash\nresult=${var:+\"var is set\"}\nflags=\"${verbose:+-v}\"\n```"
|
|
999
|
+
},
|
|
1000
|
+
"insertText": "${${1:var}:+${2:alternate}}",
|
|
1001
|
+
"insertTextRules": 4,
|
|
1002
|
+
"sortText": "04_var_alternate"
|
|
1003
|
+
},
|
|
1004
|
+
{
|
|
1005
|
+
"label": "${var:=default}",
|
|
1006
|
+
"kind": 5,
|
|
1007
|
+
"detail": "Assign default if unset",
|
|
1008
|
+
"documentation": {
|
|
1009
|
+
"value": "Assign default value if variable is unset or null.\n\n```bash\n: ${CONFIG_DIR:=/etc/myapp}\necho ${name:=\"Anonymous\"}\n```"
|
|
1010
|
+
},
|
|
1011
|
+
"insertText": "${${1:var}:=${2:default}}",
|
|
1012
|
+
"insertTextRules": 4,
|
|
1013
|
+
"sortText": "04_var_assign_default"
|
|
1014
|
+
},
|
|
1015
|
+
{
|
|
1016
|
+
"label": "${var:?error}",
|
|
1017
|
+
"kind": 5,
|
|
1018
|
+
"detail": "Error if variable unset",
|
|
1019
|
+
"documentation": {
|
|
1020
|
+
"value": "Display error and exit if variable is unset or null.\n\n```bash\n: ${HOME:?\"HOME is not set\"}\nfile=${1:?\"Usage: $0 <filename>\"}\n```"
|
|
1021
|
+
},
|
|
1022
|
+
"insertText": "${${1:var}:?${2:error message}}",
|
|
1023
|
+
"insertTextRules": 4,
|
|
1024
|
+
"sortText": "04_var_error"
|
|
1025
|
+
},
|
|
1026
|
+
{
|
|
1027
|
+
"label": "${#var}",
|
|
1028
|
+
"kind": 5,
|
|
1029
|
+
"detail": "String length",
|
|
1030
|
+
"documentation": {
|
|
1031
|
+
"value": "Get the length of a string variable.\n\n```bash\nstr=\"Hello\"\necho ${#str} # 5\necho ${#arr[@]} # array length\n```"
|
|
1032
|
+
},
|
|
1033
|
+
"insertText": "${#${1:var}}",
|
|
1034
|
+
"insertTextRules": 4,
|
|
1035
|
+
"sortText": "04_var_length"
|
|
1036
|
+
},
|
|
1037
|
+
{
|
|
1038
|
+
"label": "${var%pattern}",
|
|
1039
|
+
"kind": 5,
|
|
1040
|
+
"detail": "Remove shortest suffix match",
|
|
1041
|
+
"documentation": {
|
|
1042
|
+
"value": "Remove shortest trailing pattern match.\n\n```bash\npath=\"/home/user/file.txt\"\necho ${path%/*} # /home/user\necho ${path%.txt} # /home/user/file\n```"
|
|
1043
|
+
},
|
|
1044
|
+
"insertText": "${${1:var}%${2:pattern}}",
|
|
1045
|
+
"insertTextRules": 4,
|
|
1046
|
+
"sortText": "04_var_suffix_short"
|
|
1047
|
+
},
|
|
1048
|
+
{
|
|
1049
|
+
"label": "${var%%pattern}",
|
|
1050
|
+
"kind": 5,
|
|
1051
|
+
"detail": "Remove longest suffix match",
|
|
1052
|
+
"documentation": {
|
|
1053
|
+
"value": "Remove longest trailing pattern match.\n\n```bash\npath=\"dir1/dir2/file.tar.gz\"\necho ${path%%/*} # dir1\necho ${path%%.*} # dir1/dir2/file\n```"
|
|
1054
|
+
},
|
|
1055
|
+
"insertText": "${${1:var}%%${2:pattern}}",
|
|
1056
|
+
"insertTextRules": 4,
|
|
1057
|
+
"sortText": "04_var_suffix_long"
|
|
1058
|
+
},
|
|
1059
|
+
{
|
|
1060
|
+
"label": "${var#pattern}",
|
|
1061
|
+
"kind": 5,
|
|
1062
|
+
"detail": "Remove shortest prefix match",
|
|
1063
|
+
"documentation": {
|
|
1064
|
+
"value": "Remove shortest leading pattern match.\n\n```bash\npath=\"/home/user/file.txt\"\necho ${path#*/} # home/user/file.txt\n```"
|
|
1065
|
+
},
|
|
1066
|
+
"insertText": "${${1:var}#${2:pattern}}",
|
|
1067
|
+
"insertTextRules": 4,
|
|
1068
|
+
"sortText": "04_var_prefix_short"
|
|
1069
|
+
},
|
|
1070
|
+
{
|
|
1071
|
+
"label": "${var##pattern}",
|
|
1072
|
+
"kind": 5,
|
|
1073
|
+
"detail": "Remove longest prefix match",
|
|
1074
|
+
"documentation": {
|
|
1075
|
+
"value": "Remove longest leading pattern match.\n\n```bash\npath=\"/home/user/file.txt\"\necho ${path##*/} # file.txt\n```"
|
|
1076
|
+
},
|
|
1077
|
+
"insertText": "${${1:var}##${2:pattern}}",
|
|
1078
|
+
"insertTextRules": 4,
|
|
1079
|
+
"sortText": "04_var_prefix_long"
|
|
1080
|
+
},
|
|
1081
|
+
{
|
|
1082
|
+
"label": "${var/pattern/replacement}",
|
|
1083
|
+
"kind": 5,
|
|
1084
|
+
"detail": "Pattern substitution (first match)",
|
|
1085
|
+
"documentation": {
|
|
1086
|
+
"value": "Replace first match of pattern.\n\n```bash\nstr=\"hello world hello\"\necho ${str/hello/Hi} # Hi world hello\n```"
|
|
1087
|
+
},
|
|
1088
|
+
"insertText": "${${1:var}/${2:pattern}/${3:replacement}}",
|
|
1089
|
+
"insertTextRules": 4,
|
|
1090
|
+
"sortText": "04_var_replace"
|
|
1091
|
+
},
|
|
1092
|
+
{
|
|
1093
|
+
"label": "${var//pattern/replacement}",
|
|
1094
|
+
"kind": 5,
|
|
1095
|
+
"detail": "Pattern substitution (all matches)",
|
|
1096
|
+
"documentation": {
|
|
1097
|
+
"value": "Replace all matches of pattern.\n\n```bash\nstr=\"hello world hello\"\necho ${str//hello/Hi} # Hi world Hi\n```"
|
|
1098
|
+
},
|
|
1099
|
+
"insertText": "${${1:var}//${2:pattern}/${3:replacement}}",
|
|
1100
|
+
"insertTextRules": 4,
|
|
1101
|
+
"sortText": "04_var_replace_all"
|
|
1102
|
+
},
|
|
1103
|
+
{
|
|
1104
|
+
"label": "${var:offset:length}",
|
|
1105
|
+
"kind": 5,
|
|
1106
|
+
"detail": "Substring extraction",
|
|
1107
|
+
"documentation": {
|
|
1108
|
+
"value": "Extract a substring.\n\n```bash\nstr=\"Hello World\"\necho ${str:0:5} # Hello\necho ${str:6} # World\necho ${str: -5} # World (note the space)\n```"
|
|
1109
|
+
},
|
|
1110
|
+
"insertText": "${${1:var}:${2:offset}:${3:length}}",
|
|
1111
|
+
"insertTextRules": 4,
|
|
1112
|
+
"sortText": "04_var_substring"
|
|
1113
|
+
},
|
|
1114
|
+
{
|
|
1115
|
+
"label": "${var^}",
|
|
1116
|
+
"kind": 5,
|
|
1117
|
+
"detail": "Uppercase first character",
|
|
1118
|
+
"documentation": {
|
|
1119
|
+
"value": "Convert first character to uppercase.\n\n```bash\nname=\"alice\"\necho ${name^} # Alice\necho ${name^^} # ALICE (all uppercase)\n```"
|
|
1120
|
+
},
|
|
1121
|
+
"insertText": "${${1:var}^}",
|
|
1122
|
+
"insertTextRules": 4,
|
|
1123
|
+
"sortText": "04_var_upper"
|
|
1124
|
+
},
|
|
1125
|
+
{
|
|
1126
|
+
"label": "${var,}",
|
|
1127
|
+
"kind": 5,
|
|
1128
|
+
"detail": "Lowercase first character",
|
|
1129
|
+
"documentation": {
|
|
1130
|
+
"value": "Convert first character to lowercase.\n\n```bash\nname=\"ALICE\"\necho ${name,} # aLICE\necho ${name,,} # alice (all lowercase)\n```"
|
|
1131
|
+
},
|
|
1132
|
+
"insertText": "${${1:var},}",
|
|
1133
|
+
"insertTextRules": 4,
|
|
1134
|
+
"sortText": "04_var_lower"
|
|
1135
|
+
},
|
|
1136
|
+
{
|
|
1137
|
+
"label": "if-then-fi",
|
|
1138
|
+
"kind": 27,
|
|
1139
|
+
"detail": "If-then-fi block (snippet)",
|
|
1140
|
+
"documentation": {
|
|
1141
|
+
"value": "Complete if-then-fi conditional block.\n\n```bash\nif [[ condition ]]; then\n commands\nfi\n```"
|
|
1142
|
+
},
|
|
1143
|
+
"insertText": "if [[ ${1:condition} ]]; then\n\t${2:# commands}\nfi",
|
|
1144
|
+
"insertTextRules": 4,
|
|
1145
|
+
"sortText": "05_snip_if"
|
|
1146
|
+
},
|
|
1147
|
+
{
|
|
1148
|
+
"label": "if-then-else-fi",
|
|
1149
|
+
"kind": 27,
|
|
1150
|
+
"detail": "If-then-else-fi block (snippet)",
|
|
1151
|
+
"documentation": {
|
|
1152
|
+
"value": "Complete if-then-else-fi block.\n\n```bash\nif [[ condition ]]; then\n commands\nelse\n other_commands\nfi\n```"
|
|
1153
|
+
},
|
|
1154
|
+
"insertText": "if [[ ${1:condition} ]]; then\n\t${2:# true branch}\nelse\n\t${3:# false branch}\nfi",
|
|
1155
|
+
"insertTextRules": 4,
|
|
1156
|
+
"sortText": "05_snip_if_else"
|
|
1157
|
+
},
|
|
1158
|
+
{
|
|
1159
|
+
"label": "for-in-do-done",
|
|
1160
|
+
"kind": 27,
|
|
1161
|
+
"detail": "For-in loop (snippet)",
|
|
1162
|
+
"documentation": {
|
|
1163
|
+
"value": "For-in loop over a list.\n\n```bash\nfor item in \"${array[@]}\"; do\n echo \"$item\"\ndone\n```"
|
|
1164
|
+
},
|
|
1165
|
+
"insertText": "for ${1:item} in ${2:\"$\\{list[@]\\}\"}; do\n\t${3:echo \"\\$${1:item}\"}\ndone",
|
|
1166
|
+
"insertTextRules": 4,
|
|
1167
|
+
"sortText": "05_snip_for_in"
|
|
1168
|
+
},
|
|
1169
|
+
{
|
|
1170
|
+
"label": "for-c-style",
|
|
1171
|
+
"kind": 27,
|
|
1172
|
+
"detail": "C-style for loop (snippet)",
|
|
1173
|
+
"documentation": {
|
|
1174
|
+
"value": "C-style for loop.\n\n```bash\nfor ((i=0; i<10; i++)); do\n echo \"$i\"\ndone\n```"
|
|
1175
|
+
},
|
|
1176
|
+
"insertText": "for ((${1:i}=${2:0}; ${1:i}<${3:10}; ${1:i}++)); do\n\t${4:echo \"\\$${1:i}\"}\ndone",
|
|
1177
|
+
"insertTextRules": 4,
|
|
1178
|
+
"sortText": "05_snip_for_c"
|
|
1179
|
+
},
|
|
1180
|
+
{
|
|
1181
|
+
"label": "while-read-loop",
|
|
1182
|
+
"kind": 27,
|
|
1183
|
+
"detail": "While-read loop (snippet)",
|
|
1184
|
+
"documentation": {
|
|
1185
|
+
"value": "Read a file line by line.\n\n```bash\nwhile IFS= read -r line; do\n echo \"$line\"\ndone < file.txt\n```"
|
|
1186
|
+
},
|
|
1187
|
+
"insertText": "while IFS= read -r ${1:line}; do\n\t${2:echo \"\\$${1:line}\"}\ndone < ${3:file.txt}",
|
|
1188
|
+
"insertTextRules": 4,
|
|
1189
|
+
"sortText": "05_snip_while_read"
|
|
1190
|
+
},
|
|
1191
|
+
{
|
|
1192
|
+
"label": "while-true-loop",
|
|
1193
|
+
"kind": 27,
|
|
1194
|
+
"detail": "Infinite while loop (snippet)",
|
|
1195
|
+
"documentation": {
|
|
1196
|
+
"value": "Infinite loop until break.\n\n```bash\nwhile true; do\n commands\n [[ condition ]] && break\ndone\n```"
|
|
1197
|
+
},
|
|
1198
|
+
"insertText": "while true; do\n\t${1:# commands}\n\t${2:break}\ndone",
|
|
1199
|
+
"insertTextRules": 4,
|
|
1200
|
+
"sortText": "05_snip_while_true"
|
|
1201
|
+
},
|
|
1202
|
+
{
|
|
1203
|
+
"label": "case-esac",
|
|
1204
|
+
"kind": 27,
|
|
1205
|
+
"detail": "Case statement (snippet)",
|
|
1206
|
+
"documentation": {
|
|
1207
|
+
"value": "Pattern matching case statement.\n\n```bash\ncase \"$var\" in\n pattern1) commands ;;\n pattern2) commands ;;\n *) default ;;\nesac\n```"
|
|
1208
|
+
},
|
|
1209
|
+
"insertText": "case \"${1:\\$variable}\" in\n\t${2:pattern1})\n\t\t${3:commands}\n\t\t;;\n\t${4:pattern2})\n\t\t${5:commands}\n\t\t;;\n\t*)\n\t\t${6:echo \"Unknown option\"}\n\t\t;;\nesac",
|
|
1210
|
+
"insertTextRules": 4,
|
|
1211
|
+
"sortText": "05_snip_case"
|
|
1212
|
+
},
|
|
1213
|
+
{
|
|
1214
|
+
"label": "function-def",
|
|
1215
|
+
"kind": 27,
|
|
1216
|
+
"detail": "Function definition (snippet)",
|
|
1217
|
+
"documentation": {
|
|
1218
|
+
"value": "Define a new shell function.\n\n```bash\nmy_function() {\n local arg1=\"$1\"\n # function body\n}\n```"
|
|
1219
|
+
},
|
|
1220
|
+
"insertText": "${1:function_name}() {\n\tlocal ${2:arg}=\"\\$1\"\n\t${3:# function body}\n}",
|
|
1221
|
+
"insertTextRules": 4,
|
|
1222
|
+
"sortText": "05_snip_function"
|
|
1223
|
+
},
|
|
1224
|
+
{
|
|
1225
|
+
"label": "#!/bin/bash",
|
|
1226
|
+
"kind": 27,
|
|
1227
|
+
"detail": "Bash shebang (snippet)",
|
|
1228
|
+
"documentation": {
|
|
1229
|
+
"value": "Shebang line for a bash script with strict mode.\n\n```bash\n#!/bin/bash\nset -euo pipefail\n```"
|
|
1230
|
+
},
|
|
1231
|
+
"insertText": "#!/bin/bash\nset -euo pipefail\nIFS=$$'\\n\\t'\n\n${1:# Script starts here}",
|
|
1232
|
+
"insertTextRules": 4,
|
|
1233
|
+
"sortText": "05_snip_shebang"
|
|
1234
|
+
},
|
|
1235
|
+
{
|
|
1236
|
+
"label": "#!/usr/bin/env bash",
|
|
1237
|
+
"kind": 27,
|
|
1238
|
+
"detail": "Portable bash shebang (snippet)",
|
|
1239
|
+
"documentation": {
|
|
1240
|
+
"value": "Portable shebang line using env to find bash.\n\n```bash\n#!/usr/bin/env bash\nset -euo pipefail\n```"
|
|
1241
|
+
},
|
|
1242
|
+
"insertText": "#!/usr/bin/env bash\nset -euo pipefail\n\n${1:# Script starts here}",
|
|
1243
|
+
"insertTextRules": 4,
|
|
1244
|
+
"sortText": "05_snip_shebang_env"
|
|
1245
|
+
},
|
|
1246
|
+
{
|
|
1247
|
+
"label": "heredoc",
|
|
1248
|
+
"kind": 27,
|
|
1249
|
+
"detail": "Here document (snippet)",
|
|
1250
|
+
"documentation": {
|
|
1251
|
+
"value": "Multi-line string using a here document.\n\n```bash\ncat <<EOF\nHello, $USER.\nToday is $(date).\nEOF\n\ncat <<'EOF' # no variable expansion\n$literal \\text\nEOF\n```"
|
|
1252
|
+
},
|
|
1253
|
+
"insertText": "cat <<${1:EOF}\n${2:content}\n${1:EOF}",
|
|
1254
|
+
"insertTextRules": 4,
|
|
1255
|
+
"sortText": "05_snip_heredoc"
|
|
1256
|
+
},
|
|
1257
|
+
{
|
|
1258
|
+
"label": "herestring",
|
|
1259
|
+
"kind": 27,
|
|
1260
|
+
"detail": "Here string (snippet)",
|
|
1261
|
+
"documentation": {
|
|
1262
|
+
"value": "Feed a string to a command's stdin.\n\n```bash\nread -r first rest <<< \"Hello World\"\ngrep \"pattern\" <<< \"$string_var\"\n```"
|
|
1263
|
+
},
|
|
1264
|
+
"insertText": "<<< \"${1:string}\"",
|
|
1265
|
+
"insertTextRules": 4,
|
|
1266
|
+
"sortText": "05_snip_herestring"
|
|
1267
|
+
},
|
|
1268
|
+
{
|
|
1269
|
+
"label": "trap-cleanup",
|
|
1270
|
+
"kind": 27,
|
|
1271
|
+
"detail": "Trap cleanup on exit (snippet)",
|
|
1272
|
+
"documentation": {
|
|
1273
|
+
"value": "Set up a cleanup function that runs on script exit.\n\n```bash\ncleanup() {\n rm -rf \"$tmpdir\"\n}\ntrap cleanup EXIT\n```"
|
|
1274
|
+
},
|
|
1275
|
+
"insertText": "cleanup() {\n\t${1:rm -rf \"\\$tmpdir\"}\n}\ntrap cleanup EXIT",
|
|
1276
|
+
"insertTextRules": 4,
|
|
1277
|
+
"sortText": "05_snip_trap_cleanup"
|
|
1278
|
+
},
|
|
1279
|
+
{
|
|
1280
|
+
"label": "getopts-loop",
|
|
1281
|
+
"kind": 27,
|
|
1282
|
+
"detail": "Parse options with getopts (snippet)",
|
|
1283
|
+
"documentation": {
|
|
1284
|
+
"value": "Parse command-line options.\n\n```bash\nwhile getopts \":hv:f:\" opt; do\n case $opt in\n h) usage ;;\n v) verbose=1 ;;\n f) file=\"$OPTARG\" ;;\n \\?) echo \"Invalid: -$OPTARG\" ;;\n :) echo \"Missing arg: -$OPTARG\" ;;\n esac\ndone\nshift $((OPTIND - 1))\n```"
|
|
1285
|
+
},
|
|
1286
|
+
"insertText": "while getopts \":${1:hv:f:}\" opt; do\n\tcase \\$opt in\n\t\t${2:h}) ${3:usage} ;;\n\t\t${4:v}) ${5:verbose=1} ;;\n\t\t${6:f}) ${7:file=\"\\$OPTARG\"} ;;\n\t\t\\\\?) echo \"Invalid option: -\\$OPTARG\" >&2; exit 1 ;;\n\t\t:) echo \"Option -\\$OPTARG requires an argument\" >&2; exit 1 ;;\n\tesac\ndone\nshift \\$((OPTIND - 1))",
|
|
1287
|
+
"insertTextRules": 4,
|
|
1288
|
+
"sortText": "05_snip_getopts"
|
|
1289
|
+
},
|
|
1290
|
+
{
|
|
1291
|
+
"label": "array-iterate",
|
|
1292
|
+
"kind": 27,
|
|
1293
|
+
"detail": "Iterate over array (snippet)",
|
|
1294
|
+
"documentation": {
|
|
1295
|
+
"value": "Loop over all elements of an array.\n\n```bash\nfor item in \"${array[@]}\"; do\n echo \"$item\"\ndone\n```"
|
|
1296
|
+
},
|
|
1297
|
+
"insertText": "for ${1:item} in \"${${2:array}[@]}\"; do\n\techo \"\\$${1:item}\"\ndone",
|
|
1298
|
+
"insertTextRules": 4,
|
|
1299
|
+
"sortText": "05_snip_array_iter"
|
|
1300
|
+
},
|
|
1301
|
+
{
|
|
1302
|
+
"label": "pipe-while",
|
|
1303
|
+
"kind": 27,
|
|
1304
|
+
"detail": "Process command output line by line (snippet)",
|
|
1305
|
+
"documentation": {
|
|
1306
|
+
"value": "Pipe command output to a while-read loop.\n\n```bash\ncommand | while IFS= read -r line; do\n echo \"$line\"\ndone\n```"
|
|
1307
|
+
},
|
|
1308
|
+
"insertText": "${1:command} | while IFS= read -r ${2:line}; do\n\techo \"\\$${2:line}\"\ndone",
|
|
1309
|
+
"insertTextRules": 4,
|
|
1310
|
+
"sortText": "05_snip_pipe_while"
|
|
1311
|
+
},
|
|
1312
|
+
{
|
|
1313
|
+
"label": "process-substitution",
|
|
1314
|
+
"kind": 27,
|
|
1315
|
+
"detail": "Process substitution (snippet)",
|
|
1316
|
+
"documentation": {
|
|
1317
|
+
"value": "Use command output as a file.\n\n```bash\ndiff <(command1) <(command2)\nwhile read -r line; do\n echo \"$line\"\ndone < <(command)\n```"
|
|
1318
|
+
},
|
|
1319
|
+
"insertText": "<(${1:command})",
|
|
1320
|
+
"insertTextRules": 4,
|
|
1321
|
+
"sortText": "05_snip_proc_sub"
|
|
1322
|
+
},
|
|
1323
|
+
{
|
|
1324
|
+
"label": "command-substitution",
|
|
1325
|
+
"kind": 27,
|
|
1326
|
+
"detail": "Command substitution (snippet)",
|
|
1327
|
+
"documentation": {
|
|
1328
|
+
"value": "Capture command output into a variable.\n\n```bash\nresult=$(command arg1 arg2)\ntoday=$(date +%Y-%m-%d)\ncount=$(wc -l < file.txt)\n```"
|
|
1329
|
+
},
|
|
1330
|
+
"insertText": "$(${1:command})",
|
|
1331
|
+
"insertTextRules": 4,
|
|
1332
|
+
"sortText": "05_snip_cmd_sub"
|
|
1333
|
+
},
|
|
1334
|
+
{
|
|
1335
|
+
"label": "arithmetic",
|
|
1336
|
+
"kind": 27,
|
|
1337
|
+
"detail": "Arithmetic expression (snippet)",
|
|
1338
|
+
"documentation": {
|
|
1339
|
+
"value": "Perform arithmetic.\n\n```bash\n((count++))\n((result = a + b))\nif ((x > 10)); then echo \"big\"; fi\nresult=$((a * b + c))\n```"
|
|
1340
|
+
},
|
|
1341
|
+
"insertText": "$((${1:expression}))",
|
|
1342
|
+
"insertTextRules": 4,
|
|
1343
|
+
"sortText": "05_snip_arithmetic"
|
|
1344
|
+
},
|
|
1345
|
+
{
|
|
1346
|
+
"label": "tempfile",
|
|
1347
|
+
"kind": 27,
|
|
1348
|
+
"detail": "Create temporary file (snippet)",
|
|
1349
|
+
"documentation": {
|
|
1350
|
+
"value": "Safely create and clean up a temporary file.\n\n```bash\ntmpfile=$(mktemp)\ntrap 'rm -f \"$tmpfile\"' EXIT\n```"
|
|
1351
|
+
},
|
|
1352
|
+
"insertText": "${1:tmpfile}=$(mktemp)\ntrap 'rm -f \"\\$${1:tmpfile}\"' EXIT",
|
|
1353
|
+
"insertTextRules": 4,
|
|
1354
|
+
"sortText": "05_snip_tempfile"
|
|
1355
|
+
},
|
|
1356
|
+
{
|
|
1357
|
+
"label": "tempdir",
|
|
1358
|
+
"kind": 27,
|
|
1359
|
+
"detail": "Create temporary directory (snippet)",
|
|
1360
|
+
"documentation": {
|
|
1361
|
+
"value": "Safely create and clean up a temporary directory.\n\n```bash\ntmpdir=$(mktemp -d)\ntrap 'rm -rf \"$tmpdir\"' EXIT\n```"
|
|
1362
|
+
},
|
|
1363
|
+
"insertText": "${1:tmpdir}=$(mktemp -d)\ntrap 'rm -rf \"\\$${1:tmpdir}\"' EXIT",
|
|
1364
|
+
"insertTextRules": 4,
|
|
1365
|
+
"sortText": "05_snip_tempdir"
|
|
1366
|
+
},
|
|
1367
|
+
{
|
|
1368
|
+
"label": "check-command-exists",
|
|
1369
|
+
"kind": 27,
|
|
1370
|
+
"detail": "Check if command exists (snippet)",
|
|
1371
|
+
"documentation": {
|
|
1372
|
+
"value": "Verify a command is available before using it.\n\n```bash\nif ! command -v docker &> /dev/null; then\n echo \"docker not found\"\n exit 1\nfi\n```"
|
|
1373
|
+
},
|
|
1374
|
+
"insertText": "if ! command -v ${1:command} &> /dev/null; then\n\techo \"${1:command} is not installed\" >&2\n\texit 1\nfi",
|
|
1375
|
+
"insertTextRules": 4,
|
|
1376
|
+
"sortText": "05_snip_check_cmd"
|
|
1377
|
+
},
|
|
1378
|
+
{
|
|
1379
|
+
"label": "error-handling",
|
|
1380
|
+
"kind": 27,
|
|
1381
|
+
"detail": "Error handling function (snippet)",
|
|
1382
|
+
"documentation": {
|
|
1383
|
+
"value": "Define an error handler with line number reporting.\n\n```bash\ndie() {\n echo \"Error: $*\" >&2\n exit 1\n}\n```"
|
|
1384
|
+
},
|
|
1385
|
+
"insertText": "die() {\n\techo \"Error: \\$*\" >&2\n\texit 1\n}",
|
|
1386
|
+
"insertTextRules": 4,
|
|
1387
|
+
"sortText": "05_snip_error_handling"
|
|
1388
|
+
},
|
|
1389
|
+
{
|
|
1390
|
+
"label": "logging",
|
|
1391
|
+
"kind": 27,
|
|
1392
|
+
"detail": "Logging functions (snippet)",
|
|
1393
|
+
"documentation": {
|
|
1394
|
+
"value": "Simple logging functions.\n\n```bash\nlog() { echo \"[$(date +'%Y-%m-%d %H:%M:%S')] $*\"; }\nwarn() { log \"WARN: $*\" >&2; }\nerr() { log \"ERROR: $*\" >&2; }\n```"
|
|
1395
|
+
},
|
|
1396
|
+
"insertText": "log() { echo \"[\\$(date +'%Y-%m-%d %H:%M:%S')] \\$*\"; }\nwarn() { log \"WARN: \\$*\" >&2; }\nerr() { log \"ERROR: \\$*\" >&2; }",
|
|
1397
|
+
"insertTextRules": 4,
|
|
1398
|
+
"sortText": "05_snip_logging"
|
|
1399
|
+
},
|
|
1400
|
+
{
|
|
1401
|
+
"label": "script-dir",
|
|
1402
|
+
"kind": 27,
|
|
1403
|
+
"detail": "Get script directory (snippet)",
|
|
1404
|
+
"documentation": {
|
|
1405
|
+
"value": "Reliably get the directory of the current script.\n\n```bash\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\n```"
|
|
1406
|
+
},
|
|
1407
|
+
"insertText": "SCRIPT_DIR=\"\\$(cd \"\\$(dirname \"\\${BASH_SOURCE[0]}\")\" && pwd)\"",
|
|
1408
|
+
"insertTextRules": 4,
|
|
1409
|
+
"sortText": "05_snip_script_dir"
|
|
1410
|
+
},
|
|
1411
|
+
{
|
|
1412
|
+
"label": "confirm-prompt",
|
|
1413
|
+
"kind": 27,
|
|
1414
|
+
"detail": "Confirmation prompt (snippet)",
|
|
1415
|
+
"documentation": {
|
|
1416
|
+
"value": "Ask for user confirmation.\n\n```bash\nread -rp \"Are you sure? [y/N] \" ans\n[[ \"$ans\" =~ ^[Yy] ]] || exit 0\n```"
|
|
1417
|
+
},
|
|
1418
|
+
"insertText": "read -rp \"${1:Are you sure?} [y/N] \" ans\n[[ \"\\$ans\" =~ ^[Yy] ]] || exit 0",
|
|
1419
|
+
"insertTextRules": 4,
|
|
1420
|
+
"sortText": "05_snip_confirm"
|
|
1421
|
+
},
|
|
1422
|
+
{
|
|
1423
|
+
"label": "retry-loop",
|
|
1424
|
+
"kind": 27,
|
|
1425
|
+
"detail": "Retry a command (snippet)",
|
|
1426
|
+
"documentation": {
|
|
1427
|
+
"value": "Retry a command with exponential backoff.\n\n```bash\nretry() {\n local max=5 delay=1 i\n for ((i=1; i<=max; i++)); do\n \"$@\" && return 0\n sleep $delay\n ((delay *= 2))\n done\n return 1\n}\n```"
|
|
1428
|
+
},
|
|
1429
|
+
"insertText": "retry() {\n\tlocal max=${1:5} delay=1 i\n\tfor ((i=1; i<=max; i++)); do\n\t\t\"\\$@\" && return 0\n\t\techo \"Attempt \\$i/\\$max failed. Retrying in \\${delay}s...\" >&2\n\t\tsleep \\$delay\n\t\t((delay *= 2))\n\tdone\n\treturn 1\n}",
|
|
1430
|
+
"insertTextRules": 4,
|
|
1431
|
+
"sortText": "05_snip_retry"
|
|
1432
|
+
},
|
|
1433
|
+
{
|
|
1434
|
+
"label": "parallel-jobs",
|
|
1435
|
+
"kind": 27,
|
|
1436
|
+
"detail": "Run parallel background jobs (snippet)",
|
|
1437
|
+
"documentation": {
|
|
1438
|
+
"value": "Run commands in parallel and wait for all.\n\n```bash\npids=()\nfor item in \"${items[@]}\"; do\n process \"$item\" &\n pids+=(\"$!\")\ndone\nfor pid in \"${pids[@]}\"; do\n wait \"$pid\"\ndone\n```"
|
|
1439
|
+
},
|
|
1440
|
+
"insertText": "pids=()\nfor ${1:item} in \"${${2:items}[@]}\"; do\n\t${3:process} \"\\$${1:item}\" &\n\tpids+=(\"\\$!\")\ndone\nfor pid in \"\\${pids[@]}\"; do\n\twait \"\\$pid\"\ndone",
|
|
1441
|
+
"insertTextRules": 4,
|
|
1442
|
+
"sortText": "05_snip_parallel"
|
|
1443
|
+
},
|
|
1444
|
+
{
|
|
1445
|
+
"label": "basename",
|
|
1446
|
+
"kind": 1,
|
|
1447
|
+
"detail": "Strip directory from filename",
|
|
1448
|
+
"documentation": {
|
|
1449
|
+
"value": "Return the filename portion of a path.\n\n```bash\nbasename /path/to/file.txt # file.txt\nbasename /path/to/file.txt .txt # file\nbasename -a /path/a /path/b # a b\n```"
|
|
1450
|
+
},
|
|
1451
|
+
"insertText": "basename ${1:path}",
|
|
1452
|
+
"insertTextRules": 4,
|
|
1453
|
+
"sortText": "02_basename"
|
|
1454
|
+
},
|
|
1455
|
+
{
|
|
1456
|
+
"label": "dirname",
|
|
1457
|
+
"kind": 1,
|
|
1458
|
+
"detail": "Strip filename from path",
|
|
1459
|
+
"documentation": {
|
|
1460
|
+
"value": "Return the directory portion of a path.\n\n```bash\ndirname /path/to/file.txt # /path/to\ndirname ./file.txt # .\n```"
|
|
1461
|
+
},
|
|
1462
|
+
"insertText": "dirname ${1:path}",
|
|
1463
|
+
"insertTextRules": 4,
|
|
1464
|
+
"sortText": "02_dirname"
|
|
1465
|
+
},
|
|
1466
|
+
{
|
|
1467
|
+
"label": "date",
|
|
1468
|
+
"kind": 1,
|
|
1469
|
+
"detail": "Display or set date and time",
|
|
1470
|
+
"documentation": {
|
|
1471
|
+
"value": "Display the current date/time or convert date formats.\n\n```bash\ndate\ndate +\"%Y-%m-%d %H:%M:%S\"\ndate -d \"yesterday\" +%Y-%m-%d\ndate -u # UTC time\n```"
|
|
1472
|
+
},
|
|
1473
|
+
"insertText": "date +\"${1:%Y-%m-%d %H:%M:%S}\"",
|
|
1474
|
+
"insertTextRules": 4,
|
|
1475
|
+
"sortText": "02_date"
|
|
1476
|
+
},
|
|
1477
|
+
{
|
|
1478
|
+
"label": "sleep",
|
|
1479
|
+
"kind": 1,
|
|
1480
|
+
"detail": "Delay for a specified time",
|
|
1481
|
+
"documentation": {
|
|
1482
|
+
"value": "Pause execution for a specified duration.\n\n```bash\nsleep 5 # 5 seconds\nsleep 0.5 # half second\nsleep 1m # 1 minute\nsleep 1h # 1 hour\n```"
|
|
1483
|
+
},
|
|
1484
|
+
"insertText": "sleep ${1:1}",
|
|
1485
|
+
"insertTextRules": 4,
|
|
1486
|
+
"sortText": "02_sleep"
|
|
1487
|
+
},
|
|
1488
|
+
{
|
|
1489
|
+
"label": "mktemp",
|
|
1490
|
+
"kind": 1,
|
|
1491
|
+
"detail": "Create temporary file or directory",
|
|
1492
|
+
"documentation": {
|
|
1493
|
+
"value": "Safely create a temporary file or directory.\n\n```bash\ntmpfile=$(mktemp)\ntmpdir=$(mktemp -d)\nmktemp /tmp/myapp.XXXXXX\n```"
|
|
1494
|
+
},
|
|
1495
|
+
"insertText": "mktemp ${1:-d}",
|
|
1496
|
+
"insertTextRules": 4,
|
|
1497
|
+
"sortText": "02_mktemp"
|
|
1498
|
+
},
|
|
1499
|
+
{
|
|
1500
|
+
"label": "wait",
|
|
1501
|
+
"kind": 1,
|
|
1502
|
+
"detail": "Wait for background processes",
|
|
1503
|
+
"documentation": {
|
|
1504
|
+
"value": "Wait for background jobs to complete.\n\n```bash\ncommand1 &\ncommand2 &\nwait # wait for all\nwait $pid # wait for specific PID\nwait -n # wait for any one job\n```"
|
|
1505
|
+
},
|
|
1506
|
+
"insertText": "wait ${1}",
|
|
1507
|
+
"insertTextRules": 4,
|
|
1508
|
+
"sortText": "00_wait"
|
|
1509
|
+
},
|
|
1510
|
+
{
|
|
1511
|
+
"label": "jobs",
|
|
1512
|
+
"kind": 1,
|
|
1513
|
+
"detail": "List active jobs",
|
|
1514
|
+
"documentation": {
|
|
1515
|
+
"value": "Display status of jobs in the current session.\n\n```bash\njobs\njobs -l # include PID\njobs -p # PIDs only\n```"
|
|
1516
|
+
},
|
|
1517
|
+
"insertText": "jobs",
|
|
1518
|
+
"insertTextRules": 4,
|
|
1519
|
+
"sortText": "00_jobs"
|
|
1520
|
+
},
|
|
1521
|
+
{
|
|
1522
|
+
"label": "bg",
|
|
1523
|
+
"kind": 1,
|
|
1524
|
+
"detail": "Resume job in background",
|
|
1525
|
+
"documentation": {
|
|
1526
|
+
"value": "Resume a suspended job in the background.\n\n```bash\nbg # resume last stopped job\nbg %1 # resume job 1\n```"
|
|
1527
|
+
},
|
|
1528
|
+
"insertText": "bg",
|
|
1529
|
+
"insertTextRules": 4,
|
|
1530
|
+
"sortText": "00_bg"
|
|
1531
|
+
},
|
|
1532
|
+
{
|
|
1533
|
+
"label": "fg",
|
|
1534
|
+
"kind": 1,
|
|
1535
|
+
"detail": "Resume job in foreground",
|
|
1536
|
+
"documentation": {
|
|
1537
|
+
"value": "Bring a background job to the foreground.\n\n```bash\nfg # bring last job to foreground\nfg %1 # bring job 1 to foreground\n```"
|
|
1538
|
+
},
|
|
1539
|
+
"insertText": "fg",
|
|
1540
|
+
"insertTextRules": 4,
|
|
1541
|
+
"sortText": "00_fg"
|
|
1542
|
+
},
|
|
1543
|
+
{
|
|
1544
|
+
"label": "kill",
|
|
1545
|
+
"kind": 1,
|
|
1546
|
+
"detail": "Send signal to a process",
|
|
1547
|
+
"documentation": {
|
|
1548
|
+
"value": "Send a signal to a process.\n\n```bash\nkill $pid\nkill -9 $pid # SIGKILL (force)\nkill -TERM $pid # SIGTERM (graceful)\nkill -HUP $pid # SIGHUP (reload)\nkill %1 # kill job 1\n```"
|
|
1549
|
+
},
|
|
1550
|
+
"insertText": "kill ${1:pid}",
|
|
1551
|
+
"insertTextRules": 4,
|
|
1552
|
+
"sortText": "02_kill"
|
|
1553
|
+
},
|
|
1554
|
+
{
|
|
1555
|
+
"label": "mapfile",
|
|
1556
|
+
"kind": 1,
|
|
1557
|
+
"detail": "Read lines into an array",
|
|
1558
|
+
"documentation": {
|
|
1559
|
+
"value": "Read lines from stdin into an indexed array.\n\n```bash\nmapfile -t lines < file.txt\nmapfile -t words < <(echo \"a b c\" | tr ' ' '\\n')\nreadarray -t arr < file.txt # alias for mapfile\n```"
|
|
1560
|
+
},
|
|
1561
|
+
"insertText": "mapfile -t ${1:array} < ${2:file}",
|
|
1562
|
+
"insertTextRules": 4,
|
|
1563
|
+
"sortText": "00_mapfile"
|
|
1564
|
+
},
|
|
1565
|
+
{
|
|
1566
|
+
"label": "readarray",
|
|
1567
|
+
"kind": 1,
|
|
1568
|
+
"detail": "Read lines into an array (alias for mapfile)",
|
|
1569
|
+
"documentation": {
|
|
1570
|
+
"value": "Read lines from stdin into an indexed array. Alias for `mapfile`.\n\n```bash\nreadarray -t lines < file.txt\n```"
|
|
1571
|
+
},
|
|
1572
|
+
"insertText": "readarray -t ${1:array} < ${2:file}",
|
|
1573
|
+
"insertTextRules": 4,
|
|
1574
|
+
"sortText": "00_readarray"
|
|
1575
|
+
},
|
|
1576
|
+
{
|
|
1577
|
+
"label": "#!/bin/zsh",
|
|
1578
|
+
"kind": 15,
|
|
1579
|
+
"detail": "Zsh shebang",
|
|
1580
|
+
"documentation": {
|
|
1581
|
+
"value": "Zsh script shebang line."
|
|
1582
|
+
},
|
|
1583
|
+
"insertText": "#!/usr/bin/env zsh\n\n${1:# Script content}",
|
|
1584
|
+
"insertTextRules": 4,
|
|
1585
|
+
"sortText": "00_shebang"
|
|
1586
|
+
},
|
|
1587
|
+
{
|
|
1588
|
+
"label": "strict mode",
|
|
1589
|
+
"kind": 15,
|
|
1590
|
+
"detail": "Strict script mode",
|
|
1591
|
+
"documentation": {
|
|
1592
|
+
"value": "Enable strict mode for safer scripts."
|
|
1593
|
+
},
|
|
1594
|
+
"insertText": "#!/usr/bin/env zsh\nset -euo pipefail\n\n${1:# Script content}",
|
|
1595
|
+
"insertTextRules": 4,
|
|
1596
|
+
"sortText": "00_strict"
|
|
1597
|
+
},
|
|
1598
|
+
{
|
|
1599
|
+
"label": "script template",
|
|
1600
|
+
"kind": 15,
|
|
1601
|
+
"detail": "Full script template",
|
|
1602
|
+
"documentation": {
|
|
1603
|
+
"value": "Production zsh script template with error handling."
|
|
1604
|
+
},
|
|
1605
|
+
"insertText": "#!/usr/bin/env zsh\nset -euo pipefail\n\n# Colors\nRED='\\033[0;31m'\nGREEN='\\033[0;32m'\nYELLOW='\\033[1;33m'\nNC='\\033[0m'\n\nlog_info() { echo \"${GREEN}[INFO]${NC} \\$1\" }\nlog_warn() { echo \"${YELLOW}[WARN]${NC} \\$1\" >&2 }\nlog_error() { echo \"${RED}[ERROR]${NC} \\$1\" >&2 }\n\ncleanup() {\n # Cleanup code here\n ${2:true}\n}\ntrap cleanup EXIT\n\n${1:# Main logic}",
|
|
1606
|
+
"insertTextRules": 4,
|
|
1607
|
+
"sortText": "00_template"
|
|
1608
|
+
},
|
|
1609
|
+
{
|
|
1610
|
+
"label": "variable assignment",
|
|
1611
|
+
"kind": 6,
|
|
1612
|
+
"detail": "Variable",
|
|
1613
|
+
"documentation": {
|
|
1614
|
+
"value": "Assign a value to a variable."
|
|
1615
|
+
},
|
|
1616
|
+
"insertText": "${1:name}=${2:value}",
|
|
1617
|
+
"insertTextRules": 4,
|
|
1618
|
+
"sortText": "01_var"
|
|
1619
|
+
},
|
|
1620
|
+
{
|
|
1621
|
+
"label": "local variable",
|
|
1622
|
+
"kind": 6,
|
|
1623
|
+
"detail": "Local variable",
|
|
1624
|
+
"documentation": {
|
|
1625
|
+
"value": "Declare a local variable in a function."
|
|
1626
|
+
},
|
|
1627
|
+
"insertText": "local ${1:name}=${2:value}",
|
|
1628
|
+
"insertTextRules": 4,
|
|
1629
|
+
"sortText": "01_local"
|
|
1630
|
+
},
|
|
1631
|
+
{
|
|
1632
|
+
"label": "integer variable",
|
|
1633
|
+
"kind": 6,
|
|
1634
|
+
"detail": "Integer",
|
|
1635
|
+
"documentation": {
|
|
1636
|
+
"value": "Declare an integer variable."
|
|
1637
|
+
},
|
|
1638
|
+
"insertText": "integer ${1:count}=${2:0}",
|
|
1639
|
+
"insertTextRules": 4,
|
|
1640
|
+
"sortText": "01_integer"
|
|
1641
|
+
},
|
|
1642
|
+
{
|
|
1643
|
+
"label": "float variable",
|
|
1644
|
+
"kind": 6,
|
|
1645
|
+
"detail": "Float",
|
|
1646
|
+
"documentation": {
|
|
1647
|
+
"value": "Declare a float variable."
|
|
1648
|
+
},
|
|
1649
|
+
"insertText": "float ${1:value}=${2:0.0}",
|
|
1650
|
+
"insertTextRules": 4,
|
|
1651
|
+
"sortText": "01_float"
|
|
1652
|
+
},
|
|
1653
|
+
{
|
|
1654
|
+
"label": "readonly variable",
|
|
1655
|
+
"kind": 6,
|
|
1656
|
+
"detail": "Readonly",
|
|
1657
|
+
"documentation": {
|
|
1658
|
+
"value": "Declare a readonly constant."
|
|
1659
|
+
},
|
|
1660
|
+
"insertText": "readonly ${1:NAME}=${2:value}",
|
|
1661
|
+
"insertTextRules": 4,
|
|
1662
|
+
"sortText": "01_readonly"
|
|
1663
|
+
},
|
|
1664
|
+
{
|
|
1665
|
+
"label": "array declaration",
|
|
1666
|
+
"kind": 6,
|
|
1667
|
+
"detail": "Array",
|
|
1668
|
+
"documentation": {
|
|
1669
|
+
"value": "Declare an array. Zsh arrays are 1-indexed."
|
|
1670
|
+
},
|
|
1671
|
+
"insertText": "${1:arr}=(${2:item1 item2 item3})",
|
|
1672
|
+
"insertTextRules": 4,
|
|
1673
|
+
"sortText": "02_array"
|
|
1674
|
+
},
|
|
1675
|
+
{
|
|
1676
|
+
"label": "associative array",
|
|
1677
|
+
"kind": 6,
|
|
1678
|
+
"detail": "Associative array",
|
|
1679
|
+
"documentation": {
|
|
1680
|
+
"value": "Declare an associative array (hash)."
|
|
1681
|
+
},
|
|
1682
|
+
"insertText": "typeset -A ${1:hash}\n${1:hash}=(\n ${2:key1} ${3:value1}\n ${4:key2} ${5:value2}\n)",
|
|
1683
|
+
"insertTextRules": 4,
|
|
1684
|
+
"sortText": "02_assoc"
|
|
1685
|
+
},
|
|
1686
|
+
{
|
|
1687
|
+
"label": "array iteration",
|
|
1688
|
+
"kind": 15,
|
|
1689
|
+
"detail": "Iterate array",
|
|
1690
|
+
"documentation": {
|
|
1691
|
+
"value": "Loop over array elements."
|
|
1692
|
+
},
|
|
1693
|
+
"insertText": "for ${1:item} in \"\\${${2:arr}[@]}\"; do\n ${3:echo \"\\$${1:item}\"}\ndone",
|
|
1694
|
+
"insertTextRules": 4,
|
|
1695
|
+
"sortText": "02_array_iter"
|
|
1696
|
+
},
|
|
1697
|
+
{
|
|
1698
|
+
"label": "array operations",
|
|
1699
|
+
"kind": 15,
|
|
1700
|
+
"detail": "Array ops",
|
|
1701
|
+
"documentation": {
|
|
1702
|
+
"value": "Common array operations."
|
|
1703
|
+
},
|
|
1704
|
+
"insertText": "# Length: \\${#${1:arr}[@]}\n# Append: ${1:arr}+=(${2:new_item})\n# Slice: \\${${1:arr}[2,4]}\n# Remove: ${1:arr}[\\${${1:arr}[(i)${3:item}]}]=()\n# Search: \\${${1:arr}[(i)${3:item}]}",
|
|
1705
|
+
"insertTextRules": 4,
|
|
1706
|
+
"sortText": "02_array_ops"
|
|
1707
|
+
},
|
|
1708
|
+
{
|
|
1709
|
+
"label": "function with args",
|
|
1710
|
+
"kind": 3,
|
|
1711
|
+
"detail": "Function with arguments",
|
|
1712
|
+
"documentation": {
|
|
1713
|
+
"value": "Function with named parameters."
|
|
1714
|
+
},
|
|
1715
|
+
"insertText": "${1:func_name}() {\n local ${2:name}=\\$1\n local ${3:value}=\\$2\n local -a ${4:rest}=(\\${@:3})\n\n ${5:# function body}\n}",
|
|
1716
|
+
"insertTextRules": 4,
|
|
1717
|
+
"sortText": "03_func_args"
|
|
1718
|
+
},
|
|
1719
|
+
{
|
|
1720
|
+
"label": "anonymous function",
|
|
1721
|
+
"kind": 3,
|
|
1722
|
+
"detail": "Anonymous function",
|
|
1723
|
+
"documentation": {
|
|
1724
|
+
"value": "Zsh anonymous function (executed immediately)."
|
|
1725
|
+
},
|
|
1726
|
+
"insertText": "() {\n local ${1:var}=${2:value}\n ${3:# executed immediately}\n}",
|
|
1727
|
+
"insertTextRules": 4,
|
|
1728
|
+
"sortText": "03_anon"
|
|
1729
|
+
},
|
|
1730
|
+
{
|
|
1731
|
+
"label": "if-else",
|
|
1732
|
+
"kind": 15,
|
|
1733
|
+
"detail": "If-else",
|
|
1734
|
+
"documentation": {
|
|
1735
|
+
"value": "If-else conditional."
|
|
1736
|
+
},
|
|
1737
|
+
"insertText": "if [[ ${1:condition} ]]; then\n ${2:# true}\nelse\n ${3:# false}\nfi",
|
|
1738
|
+
"insertTextRules": 4,
|
|
1739
|
+
"sortText": "04_ifelse"
|
|
1740
|
+
},
|
|
1741
|
+
{
|
|
1742
|
+
"label": "if-elif-else",
|
|
1743
|
+
"kind": 15,
|
|
1744
|
+
"detail": "If-elif-else",
|
|
1745
|
+
"documentation": {
|
|
1746
|
+
"value": "Multi-branch conditional."
|
|
1747
|
+
},
|
|
1748
|
+
"insertText": "if [[ ${1:condition1} ]]; then\n ${2:# branch 1}\nelif [[ ${3:condition2} ]]; then\n ${4:# branch 2}\nelse\n ${5:# default}\nfi",
|
|
1749
|
+
"insertTextRules": 4,
|
|
1750
|
+
"sortText": "04_ifelif"
|
|
1751
|
+
},
|
|
1752
|
+
{
|
|
1753
|
+
"label": "for loop",
|
|
1754
|
+
"kind": 15,
|
|
1755
|
+
"detail": "For loop",
|
|
1756
|
+
"documentation": {
|
|
1757
|
+
"value": "Iterate over items."
|
|
1758
|
+
},
|
|
1759
|
+
"insertText": "for ${1:item} in ${2:items}; do\n ${3:echo \"\\$${1:item}\"}\ndone",
|
|
1760
|
+
"insertTextRules": 4,
|
|
1761
|
+
"sortText": "04_for"
|
|
1762
|
+
},
|
|
1763
|
+
{
|
|
1764
|
+
"label": "for loop C-style",
|
|
1765
|
+
"kind": 15,
|
|
1766
|
+
"detail": "C-style for",
|
|
1767
|
+
"documentation": {
|
|
1768
|
+
"value": "C-style for loop."
|
|
1769
|
+
},
|
|
1770
|
+
"insertText": "for ((${1:i}=0; ${1:i}<${2:10}; ${1:i}++)); do\n ${3:echo \"\\$${1:i}\"}\ndone",
|
|
1771
|
+
"insertTextRules": 4,
|
|
1772
|
+
"sortText": "04_forC"
|
|
1773
|
+
},
|
|
1774
|
+
{
|
|
1775
|
+
"label": "for loop range",
|
|
1776
|
+
"kind": 15,
|
|
1777
|
+
"detail": "Range for loop",
|
|
1778
|
+
"documentation": {
|
|
1779
|
+
"value": "Loop over numeric range."
|
|
1780
|
+
},
|
|
1781
|
+
"insertText": "for ${1:i} in {${2:1}..${3:10}}; do\n ${4:echo \"\\$${1:i}\"}\ndone",
|
|
1782
|
+
"insertTextRules": 4,
|
|
1783
|
+
"sortText": "04_forrange"
|
|
1784
|
+
},
|
|
1785
|
+
{
|
|
1786
|
+
"label": "while loop",
|
|
1787
|
+
"kind": 15,
|
|
1788
|
+
"detail": "While loop",
|
|
1789
|
+
"documentation": {
|
|
1790
|
+
"value": "While loop."
|
|
1791
|
+
},
|
|
1792
|
+
"insertText": "while ${1:condition}; do\n ${2:# body}\ndone",
|
|
1793
|
+
"insertTextRules": 4,
|
|
1794
|
+
"sortText": "04_while"
|
|
1795
|
+
},
|
|
1796
|
+
{
|
|
1797
|
+
"label": "while read line",
|
|
1798
|
+
"kind": 15,
|
|
1799
|
+
"detail": "Read lines",
|
|
1800
|
+
"documentation": {
|
|
1801
|
+
"value": "Read file/stdin line by line."
|
|
1802
|
+
},
|
|
1803
|
+
"insertText": "while IFS= read -r ${1:line}; do\n ${2:echo \"\\$${1:line}\"}\ndone < ${3:\"\\$file\"}",
|
|
1804
|
+
"insertTextRules": 4,
|
|
1805
|
+
"sortText": "04_whileread"
|
|
1806
|
+
},
|
|
1807
|
+
{
|
|
1808
|
+
"label": "until loop",
|
|
1809
|
+
"kind": 15,
|
|
1810
|
+
"detail": "Until loop",
|
|
1811
|
+
"documentation": {
|
|
1812
|
+
"value": "Loop until condition is true."
|
|
1813
|
+
},
|
|
1814
|
+
"insertText": "until ${1:condition}; do\n ${2:# body}\ndone",
|
|
1815
|
+
"insertTextRules": 4,
|
|
1816
|
+
"sortText": "04_until"
|
|
1817
|
+
},
|
|
1818
|
+
{
|
|
1819
|
+
"label": "select menu",
|
|
1820
|
+
"kind": 15,
|
|
1821
|
+
"detail": "Select menu",
|
|
1822
|
+
"documentation": {
|
|
1823
|
+
"value": "Interactive menu selection."
|
|
1824
|
+
},
|
|
1825
|
+
"insertText": "select ${1:choice} in ${2:option1 option2 option3 quit}; do\n case \\$${1:choice} in\n quit) break ;;\n *) echo \"You chose: \\$${1:choice}\" ;;\n esac\ndone",
|
|
1826
|
+
"insertTextRules": 4,
|
|
1827
|
+
"sortText": "04_select"
|
|
1828
|
+
},
|
|
1829
|
+
{
|
|
1830
|
+
"label": "string length",
|
|
1831
|
+
"kind": 15,
|
|
1832
|
+
"detail": "String length",
|
|
1833
|
+
"documentation": {
|
|
1834
|
+
"value": "Get string length."
|
|
1835
|
+
},
|
|
1836
|
+
"insertText": "\\${#${1:var}}",
|
|
1837
|
+
"insertTextRules": 4,
|
|
1838
|
+
"sortText": "05_strlen"
|
|
1839
|
+
},
|
|
1840
|
+
{
|
|
1841
|
+
"label": "substring",
|
|
1842
|
+
"kind": 15,
|
|
1843
|
+
"detail": "Substring",
|
|
1844
|
+
"documentation": {
|
|
1845
|
+
"value": "Extract substring."
|
|
1846
|
+
},
|
|
1847
|
+
"insertText": "\\${${1:var}:${2:offset}:${3:length}}",
|
|
1848
|
+
"insertTextRules": 4,
|
|
1849
|
+
"sortText": "05_substr"
|
|
1850
|
+
},
|
|
1851
|
+
{
|
|
1852
|
+
"label": "string replace",
|
|
1853
|
+
"kind": 15,
|
|
1854
|
+
"detail": "String replace",
|
|
1855
|
+
"documentation": {
|
|
1856
|
+
"value": "Replace pattern in string."
|
|
1857
|
+
},
|
|
1858
|
+
"insertText": "\\${${1:var}/${2:pattern}/${3:replacement}}",
|
|
1859
|
+
"insertTextRules": 4,
|
|
1860
|
+
"sortText": "05_strreplace"
|
|
1861
|
+
},
|
|
1862
|
+
{
|
|
1863
|
+
"label": "string replace all",
|
|
1864
|
+
"kind": 15,
|
|
1865
|
+
"detail": "Replace all",
|
|
1866
|
+
"documentation": {
|
|
1867
|
+
"value": "Replace all occurrences."
|
|
1868
|
+
},
|
|
1869
|
+
"insertText": "\\${${1:var}//${2:pattern}/${3:replacement}}",
|
|
1870
|
+
"insertTextRules": 4,
|
|
1871
|
+
"sortText": "05_strreplaceall"
|
|
1872
|
+
},
|
|
1873
|
+
{
|
|
1874
|
+
"label": "string trim prefix",
|
|
1875
|
+
"kind": 15,
|
|
1876
|
+
"detail": "Remove prefix",
|
|
1877
|
+
"documentation": {
|
|
1878
|
+
"value": "Remove shortest matching prefix."
|
|
1879
|
+
},
|
|
1880
|
+
"insertText": "\\${${1:var}#${2:pattern}}",
|
|
1881
|
+
"insertTextRules": 4,
|
|
1882
|
+
"sortText": "05_trimprefix"
|
|
1883
|
+
},
|
|
1884
|
+
{
|
|
1885
|
+
"label": "string trim suffix",
|
|
1886
|
+
"kind": 15,
|
|
1887
|
+
"detail": "Remove suffix",
|
|
1888
|
+
"documentation": {
|
|
1889
|
+
"value": "Remove shortest matching suffix."
|
|
1890
|
+
},
|
|
1891
|
+
"insertText": "\\${${1:var}%${2:pattern}}",
|
|
1892
|
+
"insertTextRules": 4,
|
|
1893
|
+
"sortText": "05_trimsuffix"
|
|
1894
|
+
},
|
|
1895
|
+
{
|
|
1896
|
+
"label": "string uppercase",
|
|
1897
|
+
"kind": 15,
|
|
1898
|
+
"detail": "Uppercase",
|
|
1899
|
+
"documentation": {
|
|
1900
|
+
"value": "Convert to uppercase."
|
|
1901
|
+
},
|
|
1902
|
+
"insertText": "\\${(U)${1:var}}",
|
|
1903
|
+
"insertTextRules": 4,
|
|
1904
|
+
"sortText": "05_upper"
|
|
1905
|
+
},
|
|
1906
|
+
{
|
|
1907
|
+
"label": "string lowercase",
|
|
1908
|
+
"kind": 15,
|
|
1909
|
+
"detail": "Lowercase",
|
|
1910
|
+
"documentation": {
|
|
1911
|
+
"value": "Convert to lowercase."
|
|
1912
|
+
},
|
|
1913
|
+
"insertText": "\\${(L)${1:var}}",
|
|
1914
|
+
"insertTextRules": 4,
|
|
1915
|
+
"sortText": "05_lower"
|
|
1916
|
+
},
|
|
1917
|
+
{
|
|
1918
|
+
"label": "string split",
|
|
1919
|
+
"kind": 15,
|
|
1920
|
+
"detail": "Split string",
|
|
1921
|
+
"documentation": {
|
|
1922
|
+
"value": "Split string into array."
|
|
1923
|
+
},
|
|
1924
|
+
"insertText": "\\${(s:${1::}:)${2:var}}",
|
|
1925
|
+
"insertTextRules": 4,
|
|
1926
|
+
"sortText": "05_split"
|
|
1927
|
+
},
|
|
1928
|
+
{
|
|
1929
|
+
"label": "string join",
|
|
1930
|
+
"kind": 15,
|
|
1931
|
+
"detail": "Join array",
|
|
1932
|
+
"documentation": {
|
|
1933
|
+
"value": "Join array into string."
|
|
1934
|
+
},
|
|
1935
|
+
"insertText": "\\${(j:${1::}:)${2:arr}}",
|
|
1936
|
+
"insertTextRules": 4,
|
|
1937
|
+
"sortText": "05_join"
|
|
1938
|
+
},
|
|
1939
|
+
{
|
|
1940
|
+
"label": "default value",
|
|
1941
|
+
"kind": 15,
|
|
1942
|
+
"detail": "Default if unset",
|
|
1943
|
+
"documentation": {
|
|
1944
|
+
"value": "Use default value if unset or empty."
|
|
1945
|
+
},
|
|
1946
|
+
"insertText": "\\${${1:var}:-${2:default}}",
|
|
1947
|
+
"insertTextRules": 4,
|
|
1948
|
+
"sortText": "06_default"
|
|
1949
|
+
},
|
|
1950
|
+
{
|
|
1951
|
+
"label": "assign default",
|
|
1952
|
+
"kind": 15,
|
|
1953
|
+
"detail": "Assign default",
|
|
1954
|
+
"documentation": {
|
|
1955
|
+
"value": "Assign default if unset."
|
|
1956
|
+
},
|
|
1957
|
+
"insertText": "\\${${1:var}:=${2:default}}",
|
|
1958
|
+
"insertTextRules": 4,
|
|
1959
|
+
"sortText": "06_assigndef"
|
|
1960
|
+
},
|
|
1961
|
+
{
|
|
1962
|
+
"label": "error if unset",
|
|
1963
|
+
"kind": 15,
|
|
1964
|
+
"detail": "Error if unset",
|
|
1965
|
+
"documentation": {
|
|
1966
|
+
"value": "Error with message if variable is unset."
|
|
1967
|
+
},
|
|
1968
|
+
"insertText": "\\${${1:var}:?${2:error message}}",
|
|
1969
|
+
"insertTextRules": 4,
|
|
1970
|
+
"sortText": "06_errorunset"
|
|
1971
|
+
},
|
|
1972
|
+
{
|
|
1973
|
+
"label": "parameter flags",
|
|
1974
|
+
"kind": 15,
|
|
1975
|
+
"detail": "Zsh param flags",
|
|
1976
|
+
"documentation": {
|
|
1977
|
+
"value": "Zsh-specific parameter expansion flags."
|
|
1978
|
+
},
|
|
1979
|
+
"insertText": "# (U) uppercase (L) lowercase (C) capitalize\n# (s:x:) split on x (j:x:) join with x\n# (f) split on newlines (F) join with newlines\n# (u) unique (o) sort (O) reverse sort\n# (S) glob sort (n) numeric sort\n# (k) keys of assoc array (v) values\n# (w) count words (W) count words (whitespace delimited)\n\\${(${1:U})${2:var}}",
|
|
1980
|
+
"insertTextRules": 4,
|
|
1981
|
+
"sortText": "06_flags"
|
|
1982
|
+
},
|
|
1983
|
+
{
|
|
1984
|
+
"label": "glob qualifiers",
|
|
1985
|
+
"kind": 15,
|
|
1986
|
+
"detail": "Glob qualifiers",
|
|
1987
|
+
"documentation": {
|
|
1988
|
+
"value": "Zsh glob qualifiers for advanced file matching."
|
|
1989
|
+
},
|
|
1990
|
+
"insertText": "# (.) regular files (/) directories (@) symlinks\n# (*) executable (r) readable (w) writable\n# (L+n) size > n bytes (Lk+n) > n KB (Lm+n) > n MB\n# (mh-n) modified < n hours ago (mw-n) < n weeks\n# (on) sort by name (oL) sort by size (om) sort by mtime\n# (On) reverse name sort ([1,5]) first 5 matches\n# (N) null glob (no error if empty)\nprint -l ${1:*}(${2:.})",
|
|
1991
|
+
"insertTextRules": 4,
|
|
1992
|
+
"sortText": "07_glob"
|
|
1993
|
+
},
|
|
1994
|
+
{
|
|
1995
|
+
"label": "recursive glob",
|
|
1996
|
+
"kind": 15,
|
|
1997
|
+
"detail": "Recursive glob",
|
|
1998
|
+
"documentation": {
|
|
1999
|
+
"value": "Match files recursively."
|
|
2000
|
+
},
|
|
2001
|
+
"insertText": "${1:**/*.${2:txt}}",
|
|
2002
|
+
"insertTextRules": 4,
|
|
2003
|
+
"sortText": "07_globrec"
|
|
2004
|
+
},
|
|
2005
|
+
{
|
|
2006
|
+
"label": "extended glob",
|
|
2007
|
+
"kind": 15,
|
|
2008
|
+
"detail": "Extended glob",
|
|
2009
|
+
"documentation": {
|
|
2010
|
+
"value": "Extended globbing patterns."
|
|
2011
|
+
},
|
|
2012
|
+
"insertText": "# (#q) glob qualifiers\n# (pattern1|pattern2) alternation\n# ^pattern negation ~pattern exclusion\n# (#cN,M) match N-M times\nsetopt EXTENDED_GLOB\nprint -l ${1:^*.bak}",
|
|
2013
|
+
"insertTextRules": 4,
|
|
2014
|
+
"sortText": "07_extglob"
|
|
2015
|
+
},
|
|
2016
|
+
{
|
|
2017
|
+
"label": "command substitution",
|
|
2018
|
+
"kind": 15,
|
|
2019
|
+
"detail": "Command substitution",
|
|
2020
|
+
"documentation": {
|
|
2021
|
+
"value": "Capture command output."
|
|
2022
|
+
},
|
|
2023
|
+
"insertText": "\\$(${1:command})",
|
|
2024
|
+
"insertTextRules": 4,
|
|
2025
|
+
"sortText": "08_cmdsub"
|
|
2026
|
+
},
|
|
2027
|
+
{
|
|
2028
|
+
"label": "process substitution",
|
|
2029
|
+
"kind": 15,
|
|
2030
|
+
"detail": "Process substitution",
|
|
2031
|
+
"documentation": {
|
|
2032
|
+
"value": "Use process output as file."
|
|
2033
|
+
},
|
|
2034
|
+
"insertText": "${1:diff} <(${2:command1}) <(${3:command2})",
|
|
2035
|
+
"insertTextRules": 4,
|
|
2036
|
+
"sortText": "08_procsub"
|
|
2037
|
+
},
|
|
2038
|
+
{
|
|
2039
|
+
"label": "background job",
|
|
2040
|
+
"kind": 15,
|
|
2041
|
+
"detail": "Background &",
|
|
2042
|
+
"documentation": {
|
|
2043
|
+
"value": "Run command in background."
|
|
2044
|
+
},
|
|
2045
|
+
"insertText": "${1:command} &\n${2:wait}",
|
|
2046
|
+
"insertTextRules": 4,
|
|
2047
|
+
"sortText": "08_bg"
|
|
2048
|
+
},
|
|
2049
|
+
{
|
|
2050
|
+
"label": "trap signal",
|
|
2051
|
+
"kind": 15,
|
|
2052
|
+
"detail": "Trap signal",
|
|
2053
|
+
"documentation": {
|
|
2054
|
+
"value": "Trap signals for cleanup."
|
|
2055
|
+
},
|
|
2056
|
+
"insertText": "trap '${1:echo \"Caught signal\"; cleanup}' ${2:INT TERM EXIT}",
|
|
2057
|
+
"insertTextRules": 4,
|
|
2058
|
+
"sortText": "08_trap"
|
|
2059
|
+
},
|
|
2060
|
+
{
|
|
2061
|
+
"label": "heredoc no expansion",
|
|
2062
|
+
"kind": 15,
|
|
2063
|
+
"detail": "Heredoc literal",
|
|
2064
|
+
"documentation": {
|
|
2065
|
+
"value": "Here document without variable expansion."
|
|
2066
|
+
},
|
|
2067
|
+
"insertText": "cat <<'${1:EOF}'\n${2:content without expansion}\n${1:EOF}",
|
|
2068
|
+
"insertTextRules": 4,
|
|
2069
|
+
"sortText": "09_heredoclit"
|
|
2070
|
+
},
|
|
2071
|
+
{
|
|
2072
|
+
"label": "redirect stderr",
|
|
2073
|
+
"kind": 15,
|
|
2074
|
+
"detail": "Redirect stderr",
|
|
2075
|
+
"documentation": {
|
|
2076
|
+
"value": "Redirect stderr to file or stdout."
|
|
2077
|
+
},
|
|
2078
|
+
"insertText": "${1:command} 2>${2:/dev/null}",
|
|
2079
|
+
"insertTextRules": 4,
|
|
2080
|
+
"sortText": "09_redir"
|
|
2081
|
+
},
|
|
2082
|
+
{
|
|
2083
|
+
"label": "redirect both",
|
|
2084
|
+
"kind": 15,
|
|
2085
|
+
"detail": "Redirect all output",
|
|
2086
|
+
"documentation": {
|
|
2087
|
+
"value": "Redirect both stdout and stderr."
|
|
2088
|
+
},
|
|
2089
|
+
"insertText": "${1:command} &> ${2:/dev/null}",
|
|
2090
|
+
"insertTextRules": 4,
|
|
2091
|
+
"sortText": "09_redirboth"
|
|
2092
|
+
},
|
|
2093
|
+
{
|
|
2094
|
+
"label": "global alias",
|
|
2095
|
+
"kind": 14,
|
|
2096
|
+
"detail": "Global alias",
|
|
2097
|
+
"documentation": {
|
|
2098
|
+
"value": "Global alias - expanded anywhere on command line."
|
|
2099
|
+
},
|
|
2100
|
+
"insertText": "alias -g ${1:G}='${2:| grep}'",
|
|
2101
|
+
"insertTextRules": 4,
|
|
2102
|
+
"sortText": "10_galias"
|
|
2103
|
+
},
|
|
2104
|
+
{
|
|
2105
|
+
"label": "suffix alias",
|
|
2106
|
+
"kind": 14,
|
|
2107
|
+
"detail": "Suffix alias",
|
|
2108
|
+
"documentation": {
|
|
2109
|
+
"value": "Open files by extension."
|
|
2110
|
+
},
|
|
2111
|
+
"insertText": "alias -s ${1:txt}='${2:vim}'",
|
|
2112
|
+
"insertTextRules": 4,
|
|
2113
|
+
"sortText": "10_salias"
|
|
2114
|
+
},
|
|
2115
|
+
{
|
|
2116
|
+
"label": "autoload",
|
|
2117
|
+
"kind": 14,
|
|
2118
|
+
"detail": "Autoload function",
|
|
2119
|
+
"documentation": {
|
|
2120
|
+
"value": "Lazy-load a function from fpath."
|
|
2121
|
+
},
|
|
2122
|
+
"insertText": "autoload -Uz ${1:function_name}",
|
|
2123
|
+
"insertTextRules": 4,
|
|
2124
|
+
"sortText": "10_autoload"
|
|
2125
|
+
},
|
|
2126
|
+
{
|
|
2127
|
+
"label": "setopt",
|
|
2128
|
+
"kind": 14,
|
|
2129
|
+
"detail": "Set option",
|
|
2130
|
+
"documentation": {
|
|
2131
|
+
"value": "Enable a shell option."
|
|
2132
|
+
},
|
|
2133
|
+
"insertText": "setopt ${1:OPTION_NAME}",
|
|
2134
|
+
"insertTextRules": 4,
|
|
2135
|
+
"sortText": "11_setopt"
|
|
2136
|
+
},
|
|
2137
|
+
{
|
|
2138
|
+
"label": "setopt common",
|
|
2139
|
+
"kind": 15,
|
|
2140
|
+
"detail": "Common options",
|
|
2141
|
+
"documentation": {
|
|
2142
|
+
"value": "Commonly used zsh options."
|
|
2143
|
+
},
|
|
2144
|
+
"insertText": "setopt AUTO_CD # cd without typing cd\nsetopt AUTO_PUSHD # Push dirs to stack\nsetopt PUSHD_IGNORE_DUPS\nsetopt GLOB_DOTS # Include dotfiles in glob\nsetopt EXTENDED_GLOB # Extended pattern matching\nsetopt NO_CASE_GLOB # Case insensitive glob\nsetopt NUMERIC_GLOB_SORT # Sort globs numerically\nsetopt CORRECT # Spelling correction\nsetopt CORRECT_ALL # Correct all arguments\nsetopt INTERACTIVE_COMMENTS # Allow comments in interactive",
|
|
2145
|
+
"insertTextRules": 4,
|
|
2146
|
+
"sortText": "11_setopt_common"
|
|
2147
|
+
},
|
|
2148
|
+
{
|
|
2149
|
+
"label": "history config",
|
|
2150
|
+
"kind": 15,
|
|
2151
|
+
"detail": "History setup",
|
|
2152
|
+
"documentation": {
|
|
2153
|
+
"value": "Complete history configuration."
|
|
2154
|
+
},
|
|
2155
|
+
"insertText": "HISTFILE=~/.zsh_history\nHISTSIZE=50000\nSAVEHIST=50000\nsetopt SHARE_HISTORY # Share across sessions\nsetopt HIST_EXPIRE_DUPS_FIRST # Expire dups first\nsetopt HIST_IGNORE_DUPS # Don't record dups\nsetopt HIST_IGNORE_ALL_DUPS # Remove older dup\nsetopt HIST_FIND_NO_DUPS # Skip dups in search\nsetopt HIST_IGNORE_SPACE # Skip space-prefixed\nsetopt HIST_SAVE_NO_DUPS\nsetopt HIST_VERIFY # Show before executing\nsetopt INC_APPEND_HISTORY # Append immediately",
|
|
2156
|
+
"insertTextRules": 4,
|
|
2157
|
+
"sortText": "12_history"
|
|
2158
|
+
},
|
|
2159
|
+
{
|
|
2160
|
+
"label": "compinit",
|
|
2161
|
+
"kind": 15,
|
|
2162
|
+
"detail": "Completion init",
|
|
2163
|
+
"documentation": {
|
|
2164
|
+
"value": "Initialize the completion system."
|
|
2165
|
+
},
|
|
2166
|
+
"insertText": "autoload -Uz compinit\ncompinit\n\nzstyle ':completion:*' menu select\nzstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'\nzstyle ':completion:*' list-colors \\${(s.:.)LS_COLORS}\nzstyle ':completion:*' use-cache on\nzstyle ':completion:*' cache-path ~/.zsh/cache",
|
|
2167
|
+
"insertTextRules": 4,
|
|
2168
|
+
"sortText": "13_compinit"
|
|
2169
|
+
},
|
|
2170
|
+
{
|
|
2171
|
+
"label": "compdef",
|
|
2172
|
+
"kind": 14,
|
|
2173
|
+
"detail": "Completion definition",
|
|
2174
|
+
"documentation": {
|
|
2175
|
+
"value": "Define completion for a command."
|
|
2176
|
+
},
|
|
2177
|
+
"insertText": "compdef ${1:_gnu_generic} ${2:command}",
|
|
2178
|
+
"insertTextRules": 4,
|
|
2179
|
+
"sortText": "13_compdef"
|
|
2180
|
+
},
|
|
2181
|
+
{
|
|
2182
|
+
"label": "completion function",
|
|
2183
|
+
"kind": 3,
|
|
2184
|
+
"detail": "Custom completion",
|
|
2185
|
+
"documentation": {
|
|
2186
|
+
"value": "Write a custom completion function."
|
|
2187
|
+
},
|
|
2188
|
+
"insertText": "_${1:mycommand}() {\n local -a subcmds\n subcmds=(\n 'start:Start the service'\n 'stop:Stop the service'\n 'status:Show status'\n )\n _describe 'command' subcmds\n}\ncompdef _${1:mycommand} ${1:mycommand}",
|
|
2189
|
+
"insertTextRules": 4,
|
|
2190
|
+
"sortText": "13_compfunc"
|
|
2191
|
+
},
|
|
2192
|
+
{
|
|
2193
|
+
"label": "zstyle",
|
|
2194
|
+
"kind": 14,
|
|
2195
|
+
"detail": "Zstyle",
|
|
2196
|
+
"documentation": {
|
|
2197
|
+
"value": "Configure completion behavior."
|
|
2198
|
+
},
|
|
2199
|
+
"insertText": "zstyle '${1::completion:*}' ${2:menu} ${3:select}",
|
|
2200
|
+
"insertTextRules": 4,
|
|
2201
|
+
"sortText": "13_zstyle"
|
|
2202
|
+
},
|
|
2203
|
+
{
|
|
2204
|
+
"label": "bindkey",
|
|
2205
|
+
"kind": 14,
|
|
2206
|
+
"detail": "Key binding",
|
|
2207
|
+
"documentation": {
|
|
2208
|
+
"value": "Bind a key to a ZLE widget."
|
|
2209
|
+
},
|
|
2210
|
+
"insertText": "bindkey '${1:^R}' ${2:history-incremental-search-backward}",
|
|
2211
|
+
"insertTextRules": 4,
|
|
2212
|
+
"sortText": "14_bindkey"
|
|
2213
|
+
},
|
|
2214
|
+
{
|
|
2215
|
+
"label": "bindkey vi mode",
|
|
2216
|
+
"kind": 15,
|
|
2217
|
+
"detail": "Vi mode",
|
|
2218
|
+
"documentation": {
|
|
2219
|
+
"value": "Enable vi mode keybindings."
|
|
2220
|
+
},
|
|
2221
|
+
"insertText": "bindkey -v\n\n# Keep useful emacs bindings in vi mode:\nbindkey '^R' history-incremental-search-backward\nbindkey '^A' beginning-of-line\nbindkey '^E' end-of-line\nbindkey '^K' kill-line\n\n# Reduce mode switch delay:\nexport KEYTIMEOUT=1",
|
|
2222
|
+
"insertTextRules": 4,
|
|
2223
|
+
"sortText": "14_bindkey_vi"
|
|
2224
|
+
},
|
|
2225
|
+
{
|
|
2226
|
+
"label": "custom widget",
|
|
2227
|
+
"kind": 15,
|
|
2228
|
+
"detail": "ZLE widget",
|
|
2229
|
+
"documentation": {
|
|
2230
|
+
"value": "Create a custom ZLE widget."
|
|
2231
|
+
},
|
|
2232
|
+
"insertText": "${1:my-widget}() {\n ${2:BUFFER=\"\\$BUFFER modified\"}\n zle redisplay\n}\nzle -N ${1:my-widget}\nbindkey '${3:^X^M}' ${1:my-widget}",
|
|
2233
|
+
"insertTextRules": 4,
|
|
2234
|
+
"sortText": "14_widget"
|
|
2235
|
+
},
|
|
2236
|
+
{
|
|
2237
|
+
"label": "PROMPT",
|
|
2238
|
+
"kind": 6,
|
|
2239
|
+
"detail": "Prompt variable",
|
|
2240
|
+
"documentation": {
|
|
2241
|
+
"value": "Set the left prompt."
|
|
2242
|
+
},
|
|
2243
|
+
"insertText": "PROMPT='${1:%F{cyan}%n@%m%f %F{yellow}%~%f %# }'",
|
|
2244
|
+
"insertTextRules": 4,
|
|
2245
|
+
"sortText": "15_prompt"
|
|
2246
|
+
},
|
|
2247
|
+
{
|
|
2248
|
+
"label": "RPROMPT",
|
|
2249
|
+
"kind": 6,
|
|
2250
|
+
"detail": "Right prompt",
|
|
2251
|
+
"documentation": {
|
|
2252
|
+
"value": "Set the right-side prompt."
|
|
2253
|
+
},
|
|
2254
|
+
"insertText": "RPROMPT='${1:%F{gray}%*%f}'",
|
|
2255
|
+
"insertTextRules": 4,
|
|
2256
|
+
"sortText": "15_rprompt"
|
|
2257
|
+
},
|
|
2258
|
+
{
|
|
2259
|
+
"label": "prompt with git",
|
|
2260
|
+
"kind": 15,
|
|
2261
|
+
"detail": "Git prompt",
|
|
2262
|
+
"documentation": {
|
|
2263
|
+
"value": "Prompt with git branch info."
|
|
2264
|
+
},
|
|
2265
|
+
"insertText": "autoload -Uz vcs_info\nprecmd() { vcs_info }\nzstyle ':vcs_info:git:*' formats ' %F{magenta}(%b)%f'\nsetopt PROMPT_SUBST\nPROMPT='%F{cyan}%~%f\\${vcs_info_msg_0_} %# '",
|
|
2266
|
+
"insertTextRules": 4,
|
|
2267
|
+
"sortText": "15_prompt_git"
|
|
2268
|
+
},
|
|
2269
|
+
{
|
|
2270
|
+
"label": "precmd hook",
|
|
2271
|
+
"kind": 3,
|
|
2272
|
+
"detail": "Precmd hook",
|
|
2273
|
+
"documentation": {
|
|
2274
|
+
"value": "Function run before each prompt."
|
|
2275
|
+
},
|
|
2276
|
+
"insertText": "precmd() {\n ${1:# Runs before each prompt display}\n}",
|
|
2277
|
+
"insertTextRules": 4,
|
|
2278
|
+
"sortText": "16_precmd"
|
|
2279
|
+
},
|
|
2280
|
+
{
|
|
2281
|
+
"label": "preexec hook",
|
|
2282
|
+
"kind": 3,
|
|
2283
|
+
"detail": "Preexec hook",
|
|
2284
|
+
"documentation": {
|
|
2285
|
+
"value": "Function run before each command."
|
|
2286
|
+
},
|
|
2287
|
+
"insertText": "preexec() {\n ${1:# \\$1 = typed command, \\$2 = expanded, \\$3 = full}\n}",
|
|
2288
|
+
"insertTextRules": 4,
|
|
2289
|
+
"sortText": "16_preexec"
|
|
2290
|
+
},
|
|
2291
|
+
{
|
|
2292
|
+
"label": "chpwd hook",
|
|
2293
|
+
"kind": 3,
|
|
2294
|
+
"detail": "Chpwd hook",
|
|
2295
|
+
"documentation": {
|
|
2296
|
+
"value": "Function run when directory changes."
|
|
2297
|
+
},
|
|
2298
|
+
"insertText": "chpwd() {\n ${1:ls}\n}",
|
|
2299
|
+
"insertTextRules": 4,
|
|
2300
|
+
"sortText": "16_chpwd"
|
|
2301
|
+
},
|
|
2302
|
+
{
|
|
2303
|
+
"label": "add-zsh-hook",
|
|
2304
|
+
"kind": 14,
|
|
2305
|
+
"detail": "Add named hook",
|
|
2306
|
+
"documentation": {
|
|
2307
|
+
"value": "Add a function to a hook array (allows multiple)."
|
|
2308
|
+
},
|
|
2309
|
+
"insertText": "autoload -Uz add-zsh-hook\nadd-zsh-hook ${1:precmd} ${2:my_function}",
|
|
2310
|
+
"insertTextRules": 4,
|
|
2311
|
+
"sortText": "16_addhook"
|
|
2312
|
+
},
|
|
2313
|
+
{
|
|
2314
|
+
"label": "PATH append",
|
|
2315
|
+
"kind": 14,
|
|
2316
|
+
"detail": "Append to PATH",
|
|
2317
|
+
"documentation": {
|
|
2318
|
+
"value": "Add directory to end of PATH."
|
|
2319
|
+
},
|
|
2320
|
+
"insertText": "export PATH=\"\\$PATH:${1:/usr/local/bin}\"",
|
|
2321
|
+
"insertTextRules": 4,
|
|
2322
|
+
"sortText": "17_path"
|
|
2323
|
+
},
|
|
2324
|
+
{
|
|
2325
|
+
"label": "PATH prepend",
|
|
2326
|
+
"kind": 14,
|
|
2327
|
+
"detail": "Prepend to PATH",
|
|
2328
|
+
"documentation": {
|
|
2329
|
+
"value": "Add directory to beginning of PATH."
|
|
2330
|
+
},
|
|
2331
|
+
"insertText": "export PATH=\"${1:\\$HOME/.local/bin}:\\$PATH\"",
|
|
2332
|
+
"insertTextRules": 4,
|
|
2333
|
+
"sortText": "17_pathpre"
|
|
2334
|
+
},
|
|
2335
|
+
{
|
|
2336
|
+
"label": "path array",
|
|
2337
|
+
"kind": 6,
|
|
2338
|
+
"detail": "Zsh path array",
|
|
2339
|
+
"documentation": {
|
|
2340
|
+
"value": "Use zsh path array (lowercase, tied to PATH)."
|
|
2341
|
+
},
|
|
2342
|
+
"insertText": "typeset -U path # unique entries\npath=(${1:\\$HOME/.local/bin} \\$path)",
|
|
2343
|
+
"insertTextRules": 4,
|
|
2344
|
+
"sortText": "17_patharray"
|
|
2345
|
+
},
|
|
2346
|
+
{
|
|
2347
|
+
"label": "oh-my-zsh setup",
|
|
2348
|
+
"kind": 15,
|
|
2349
|
+
"detail": "Oh My Zsh config",
|
|
2350
|
+
"documentation": {
|
|
2351
|
+
"value": "Oh My Zsh configuration."
|
|
2352
|
+
},
|
|
2353
|
+
"insertText": "export ZSH=\"\\$HOME/.oh-my-zsh\"\nZSH_THEME=\"${1:robbyrussell}\"\nplugins=(\n ${2:git}\n ${3:docker}\n ${4:kubectl}\n ${5:z}\n zsh-autosuggestions\n zsh-syntax-highlighting\n)\nsource \\$ZSH/oh-my-zsh.sh",
|
|
2354
|
+
"insertTextRules": 4,
|
|
2355
|
+
"sortText": "18_omz"
|
|
2356
|
+
},
|
|
2357
|
+
{
|
|
2358
|
+
"label": "zinit setup",
|
|
2359
|
+
"kind": 15,
|
|
2360
|
+
"detail": "Zinit config",
|
|
2361
|
+
"documentation": {
|
|
2362
|
+
"value": "Zinit plugin manager configuration."
|
|
2363
|
+
},
|
|
2364
|
+
"insertText": "source \"\\$HOME/.local/share/zinit/zinit.git/zinit.zsh\"\n\nzinit light zsh-users/zsh-autosuggestions\nzinit light zsh-users/zsh-syntax-highlighting\nzinit light zsh-users/zsh-completions\n\nzinit ice depth=1; zinit light romkatv/powerlevel10k",
|
|
2365
|
+
"insertTextRules": 4,
|
|
2366
|
+
"sortText": "18_zinit"
|
|
2367
|
+
},
|
|
2368
|
+
{
|
|
2369
|
+
"label": "zmodload",
|
|
2370
|
+
"kind": 14,
|
|
2371
|
+
"detail": "Load module",
|
|
2372
|
+
"documentation": {
|
|
2373
|
+
"value": "Load a zsh module."
|
|
2374
|
+
},
|
|
2375
|
+
"insertText": "zmodload ${1:zsh/datetime}",
|
|
2376
|
+
"insertTextRules": 4,
|
|
2377
|
+
"sortText": "19_zmodload"
|
|
2378
|
+
},
|
|
2379
|
+
{
|
|
2380
|
+
"label": "zparseopts",
|
|
2381
|
+
"kind": 15,
|
|
2382
|
+
"detail": "Parse options",
|
|
2383
|
+
"documentation": {
|
|
2384
|
+
"value": "Parse command-line options (zsh built-in)."
|
|
2385
|
+
},
|
|
2386
|
+
"insertText": "zparseopts -D -E -- \\\n h=help -help=help \\\n v=verbose -verbose=verbose \\\n o:=output -output:=output\n\nif (( \\${#help} )); then\n echo \"Usage: \\$0 [-h] [-v] [-o output]\"\n return 0\nfi\n\n[[ -n \\$output ]] && output=\\${output[2]}",
|
|
2387
|
+
"insertTextRules": 4,
|
|
2388
|
+
"sortText": "20_zparseopts"
|
|
2389
|
+
},
|
|
2390
|
+
{
|
|
2391
|
+
"label": "getopts",
|
|
2392
|
+
"kind": 15,
|
|
2393
|
+
"detail": "Getopts parsing",
|
|
2394
|
+
"documentation": {
|
|
2395
|
+
"value": "POSIX-compatible option parsing."
|
|
2396
|
+
},
|
|
2397
|
+
"insertText": "while getopts '${1:hvo:}' opt; do\n case \\$opt in\n h) echo \"Usage: ...\"; return 0 ;;\n v) verbose=1 ;;\n o) output=\\$OPTARG ;;\n ?) echo \"Invalid option\" >&2; return 1 ;;\n esac\ndone\nshift \\$((OPTIND - 1))",
|
|
2398
|
+
"insertTextRules": 4,
|
|
2399
|
+
"sortText": "20_getopts"
|
|
2400
|
+
},
|
|
2401
|
+
{
|
|
2402
|
+
"label": "test file exists",
|
|
2403
|
+
"kind": 15,
|
|
2404
|
+
"detail": "File exists?",
|
|
2405
|
+
"documentation": {
|
|
2406
|
+
"value": "Check if file exists."
|
|
2407
|
+
},
|
|
2408
|
+
"insertText": "if [[ -f ${1:\"\\$file\"} ]]; then\n ${2:echo \"File exists\"}\nfi",
|
|
2409
|
+
"insertTextRules": 4,
|
|
2410
|
+
"sortText": "21_testf"
|
|
2411
|
+
},
|
|
2412
|
+
{
|
|
2413
|
+
"label": "test directory",
|
|
2414
|
+
"kind": 15,
|
|
2415
|
+
"detail": "Directory exists?",
|
|
2416
|
+
"documentation": {
|
|
2417
|
+
"value": "Check if directory exists."
|
|
2418
|
+
},
|
|
2419
|
+
"insertText": "if [[ -d ${1:\"\\$dir\"} ]]; then\n ${2:echo \"Directory exists\"}\nfi",
|
|
2420
|
+
"insertTextRules": 4,
|
|
2421
|
+
"sortText": "21_testd"
|
|
2422
|
+
},
|
|
2423
|
+
{
|
|
2424
|
+
"label": "test string empty",
|
|
2425
|
+
"kind": 15,
|
|
2426
|
+
"detail": "String empty?",
|
|
2427
|
+
"documentation": {
|
|
2428
|
+
"value": "Check if variable is empty."
|
|
2429
|
+
},
|
|
2430
|
+
"insertText": "if [[ -z ${1:\"\\$var\"} ]]; then\n ${2:echo \"Empty\"}\nfi",
|
|
2431
|
+
"insertTextRules": 4,
|
|
2432
|
+
"sortText": "21_testz"
|
|
2433
|
+
},
|
|
2434
|
+
{
|
|
2435
|
+
"label": "test command exists",
|
|
2436
|
+
"kind": 15,
|
|
2437
|
+
"detail": "Command exists?",
|
|
2438
|
+
"documentation": {
|
|
2439
|
+
"value": "Check if command is available."
|
|
2440
|
+
},
|
|
2441
|
+
"insertText": "if (( \\$+commands[${1:docker}] )); then\n ${2:echo \"docker is installed\"}\nfi",
|
|
2442
|
+
"insertTextRules": 4,
|
|
2443
|
+
"sortText": "21_testcmd"
|
|
2444
|
+
}
|
|
2445
|
+
]
|
|
2446
|
+
}
|