@enjoys/context-engine 1.0.3 → 1.0.4
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/completion/awk.json +203 -0
- package/data/completion/crontab.json +203 -0
- package/data/completion/dotenv.json +170 -0
- package/data/completion/graphql.json +181 -0
- package/data/completion/hcl.json +192 -0
- package/data/completion/ini.json +137 -0
- package/data/completion/json.json +170 -0
- package/data/completion/makefile.json +203 -0
- package/data/completion/markdown.json +225 -0
- package/data/completion/nginx.json +280 -0
- package/data/completion/perl.json +203 -0
- package/data/completion/powershell.json +225 -0
- package/data/completion/protobuf.json +181 -0
- package/data/completion/ssh_config.json +159 -0
- package/data/completion/systemd.json +170 -0
- package/data/completion/xml.json +159 -0
- package/data/completion/zsh.json +214 -0
- package/data/defination/awk.json +125 -0
- package/data/defination/crontab.json +107 -0
- package/data/defination/dotenv.json +71 -0
- package/data/defination/graphql.json +119 -0
- package/data/defination/hcl.json +125 -0
- package/data/defination/ini.json +77 -0
- package/data/defination/json.json +83 -0
- package/data/defination/makefile.json +113 -0
- package/data/defination/markdown.json +107 -0
- package/data/defination/nginx.json +131 -0
- package/data/defination/perl.json +101 -0
- package/data/defination/powershell.json +119 -0
- package/data/defination/protobuf.json +119 -0
- package/data/defination/ssh_config.json +89 -0
- package/data/defination/systemd.json +107 -0
- package/data/defination/xml.json +83 -0
- package/data/defination/zsh.json +113 -0
- package/data/hover/awk.json +47 -0
- package/data/hover/crontab.json +47 -0
- package/data/hover/dotenv.json +47 -0
- package/data/hover/graphql.json +47 -0
- package/data/hover/hcl.json +75 -0
- package/data/hover/ini.json +68 -0
- package/data/hover/json.json +89 -0
- package/data/hover/makefile.json +68 -0
- package/data/hover/markdown.json +68 -0
- package/data/hover/nginx.json +89 -0
- package/data/hover/perl.json +47 -0
- package/data/hover/powershell.json +54 -0
- package/data/hover/protobuf.json +47 -0
- package/data/hover/ssh_config.json +47 -0
- package/data/hover/systemd.json +54 -0
- package/data/hover/xml.json +61 -0
- package/data/hover/zsh.json +61 -0
- package/data/manifest.json +210 -6
- package/package.json +1 -1
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
{
|
|
2
|
+
"language": "systemd",
|
|
3
|
+
"completions": [
|
|
4
|
+
{
|
|
5
|
+
"label": "[Unit]",
|
|
6
|
+
"kind": 15,
|
|
7
|
+
"detail": "Unit section",
|
|
8
|
+
"documentation": {
|
|
9
|
+
"value": "Generic information about the unit."
|
|
10
|
+
},
|
|
11
|
+
"insertText": "[Unit]\nDescription=${1:My Service}\nAfter=${2:network.target}",
|
|
12
|
+
"insertTextRules": 4,
|
|
13
|
+
"sortText": "00_unit"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"label": "[Service]",
|
|
17
|
+
"kind": 15,
|
|
18
|
+
"detail": "Service section",
|
|
19
|
+
"documentation": {
|
|
20
|
+
"value": "Service-specific configuration."
|
|
21
|
+
},
|
|
22
|
+
"insertText": "[Service]\nType=${1:simple}\nUser=${2:www-data}\nExecStart=${3:/usr/bin/myapp}\nRestart=${4:on-failure}\nRestartSec=${5:5}",
|
|
23
|
+
"insertTextRules": 4,
|
|
24
|
+
"sortText": "00_service"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"label": "[Install]",
|
|
28
|
+
"kind": 15,
|
|
29
|
+
"detail": "Install section",
|
|
30
|
+
"documentation": {
|
|
31
|
+
"value": "Installation information for systemctl enable/disable."
|
|
32
|
+
},
|
|
33
|
+
"insertText": "[Install]\nWantedBy=${1:multi-user.target}",
|
|
34
|
+
"insertTextRules": 4,
|
|
35
|
+
"sortText": "00_install"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"label": "[Timer]",
|
|
39
|
+
"kind": 15,
|
|
40
|
+
"detail": "Timer section",
|
|
41
|
+
"documentation": {
|
|
42
|
+
"value": "Timer unit configuration (cron alternative)."
|
|
43
|
+
},
|
|
44
|
+
"insertText": "[Timer]\nOnCalendar=${1:*-*-* 00:00:00}\nPersistent=true\n\n[Install]\nWantedBy=timers.target",
|
|
45
|
+
"insertTextRules": 4,
|
|
46
|
+
"sortText": "00_timer"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"label": "service template",
|
|
50
|
+
"kind": 15,
|
|
51
|
+
"detail": "Full service file",
|
|
52
|
+
"documentation": {
|
|
53
|
+
"value": "Complete systemd service unit file."
|
|
54
|
+
},
|
|
55
|
+
"insertText": "[Unit]\nDescription=${1:My Application}\nAfter=network.target\n\n[Service]\nType=simple\nUser=${2:www-data}\nGroup=${2:www-data}\nWorkingDirectory=${3:/opt/app}\nExecStart=${4:/opt/app/bin/server}\nRestart=on-failure\nRestartSec=5\nEnvironmentFile=${5:/opt/app/.env}\n\n[Install]\nWantedBy=multi-user.target",
|
|
56
|
+
"insertTextRules": 4,
|
|
57
|
+
"sortText": "01_template"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"label": "ExecStart",
|
|
61
|
+
"kind": 14,
|
|
62
|
+
"detail": "Main process command",
|
|
63
|
+
"documentation": {
|
|
64
|
+
"value": "Command to start the service."
|
|
65
|
+
},
|
|
66
|
+
"insertText": "ExecStart=${1:/usr/bin/myapp}",
|
|
67
|
+
"insertTextRules": 4,
|
|
68
|
+
"sortText": "02_execstart"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"label": "ExecStartPre",
|
|
72
|
+
"kind": 14,
|
|
73
|
+
"detail": "Pre-start command",
|
|
74
|
+
"documentation": {
|
|
75
|
+
"value": "Command to run before the main process starts."
|
|
76
|
+
},
|
|
77
|
+
"insertText": "ExecStartPre=${1:/usr/bin/setup}",
|
|
78
|
+
"insertTextRules": 4,
|
|
79
|
+
"sortText": "02_execpre"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"label": "ExecReload",
|
|
83
|
+
"kind": 14,
|
|
84
|
+
"detail": "Reload command",
|
|
85
|
+
"documentation": {
|
|
86
|
+
"value": "Command to reload the service configuration."
|
|
87
|
+
},
|
|
88
|
+
"insertText": "ExecReload=/bin/kill -HUP $MAINPID",
|
|
89
|
+
"insertTextRules": 4,
|
|
90
|
+
"sortText": "02_execreload"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"label": "Environment",
|
|
94
|
+
"kind": 14,
|
|
95
|
+
"detail": "Environment variable",
|
|
96
|
+
"documentation": {
|
|
97
|
+
"value": "Set an environment variable."
|
|
98
|
+
},
|
|
99
|
+
"insertText": "Environment=${1:KEY}=${2:value}",
|
|
100
|
+
"insertTextRules": 4,
|
|
101
|
+
"sortText": "03_env"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"label": "EnvironmentFile",
|
|
105
|
+
"kind": 14,
|
|
106
|
+
"detail": "Environment file",
|
|
107
|
+
"documentation": {
|
|
108
|
+
"value": "Load environment variables from a file."
|
|
109
|
+
},
|
|
110
|
+
"insertText": "EnvironmentFile=${1:/etc/default/myapp}",
|
|
111
|
+
"insertTextRules": 4,
|
|
112
|
+
"sortText": "03_envfile"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"label": "Restart=on-failure",
|
|
116
|
+
"kind": 14,
|
|
117
|
+
"detail": "Restart on failure",
|
|
118
|
+
"documentation": {
|
|
119
|
+
"value": "Restart the service when it exits with a non-zero code."
|
|
120
|
+
},
|
|
121
|
+
"insertText": "Restart=on-failure\nRestartSec=${1:5}",
|
|
122
|
+
"insertTextRules": 4,
|
|
123
|
+
"sortText": "03_restart"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"label": "Restart=always",
|
|
127
|
+
"kind": 14,
|
|
128
|
+
"detail": "Always restart",
|
|
129
|
+
"documentation": {
|
|
130
|
+
"value": "Always restart the service regardless of exit status."
|
|
131
|
+
},
|
|
132
|
+
"insertText": "Restart=always\nRestartSec=${1:5}",
|
|
133
|
+
"insertTextRules": 4,
|
|
134
|
+
"sortText": "03_restartalways"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"label": "LimitNOFILE",
|
|
138
|
+
"kind": 14,
|
|
139
|
+
"detail": "File descriptor limit",
|
|
140
|
+
"documentation": {
|
|
141
|
+
"value": "Set the maximum number of open file descriptors."
|
|
142
|
+
},
|
|
143
|
+
"insertText": "LimitNOFILE=${1:65536}",
|
|
144
|
+
"insertTextRules": 4,
|
|
145
|
+
"sortText": "04_limit"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"label": "OnCalendar",
|
|
149
|
+
"kind": 14,
|
|
150
|
+
"detail": "Calendar timer",
|
|
151
|
+
"documentation": {
|
|
152
|
+
"value": "Calendar-based timer expression (cron-like)."
|
|
153
|
+
},
|
|
154
|
+
"insertText": "OnCalendar=${1:daily}",
|
|
155
|
+
"insertTextRules": 4,
|
|
156
|
+
"sortText": "04_oncal"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"label": "security hardening",
|
|
160
|
+
"kind": 15,
|
|
161
|
+
"detail": "Security options",
|
|
162
|
+
"documentation": {
|
|
163
|
+
"value": "Common security hardening directives."
|
|
164
|
+
},
|
|
165
|
+
"insertText": "ProtectSystem=strict\nProtectHome=true\nNoNewPrivileges=true\nPrivateTmp=true\nReadWritePaths=${1:/var/lib/myapp}",
|
|
166
|
+
"insertTextRules": 4,
|
|
167
|
+
"sortText": "05_security"
|
|
168
|
+
}
|
|
169
|
+
]
|
|
170
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
{
|
|
2
|
+
"language": "xml",
|
|
3
|
+
"completions": [
|
|
4
|
+
{
|
|
5
|
+
"label": "XML declaration",
|
|
6
|
+
"kind": 15,
|
|
7
|
+
"detail": "XML declaration",
|
|
8
|
+
"documentation": {
|
|
9
|
+
"value": "XML version and encoding declaration at the top of the document."
|
|
10
|
+
},
|
|
11
|
+
"insertText": "<?xml version=\"${1:1.0}\" encoding=\"${2:UTF-8}\"?>",
|
|
12
|
+
"insertTextRules": 4,
|
|
13
|
+
"sortText": "00_decl"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"label": "element",
|
|
17
|
+
"kind": 15,
|
|
18
|
+
"detail": "XML element",
|
|
19
|
+
"documentation": {
|
|
20
|
+
"value": "A basic XML element with opening and closing tags."
|
|
21
|
+
},
|
|
22
|
+
"insertText": "<${1:element}>${2:content}</${1:element}>",
|
|
23
|
+
"insertTextRules": 4,
|
|
24
|
+
"sortText": "00_element"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"label": "self-closing element",
|
|
28
|
+
"kind": 15,
|
|
29
|
+
"detail": "Self-closing tag",
|
|
30
|
+
"documentation": {
|
|
31
|
+
"value": "An empty element with a self-closing tag."
|
|
32
|
+
},
|
|
33
|
+
"insertText": "<${1:element} />",
|
|
34
|
+
"insertTextRules": 4,
|
|
35
|
+
"sortText": "00_selfclose"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"label": "element with attribute",
|
|
39
|
+
"kind": 15,
|
|
40
|
+
"detail": "Element with attribute",
|
|
41
|
+
"documentation": {
|
|
42
|
+
"value": "An XML element with one or more attributes."
|
|
43
|
+
},
|
|
44
|
+
"insertText": "<${1:element} ${2:attr}=\"${3:value}\">${4:content}</${1:element}>",
|
|
45
|
+
"insertTextRules": 4,
|
|
46
|
+
"sortText": "00_elemattr"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"label": "comment",
|
|
50
|
+
"kind": 15,
|
|
51
|
+
"detail": "XML comment",
|
|
52
|
+
"documentation": {
|
|
53
|
+
"value": "An XML comment block. Cannot contain --."
|
|
54
|
+
},
|
|
55
|
+
"insertText": "<!-- ${1:comment} -->",
|
|
56
|
+
"insertTextRules": 4,
|
|
57
|
+
"sortText": "01_comment"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"label": "CDATA section",
|
|
61
|
+
"kind": 15,
|
|
62
|
+
"detail": "CDATA section",
|
|
63
|
+
"documentation": {
|
|
64
|
+
"value": "Character data section that is not parsed by the XML parser."
|
|
65
|
+
},
|
|
66
|
+
"insertText": "<![CDATA[\n ${1:content}\n]]>",
|
|
67
|
+
"insertTextRules": 4,
|
|
68
|
+
"sortText": "01_cdata"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"label": "namespace",
|
|
72
|
+
"kind": 15,
|
|
73
|
+
"detail": "XML namespace",
|
|
74
|
+
"documentation": {
|
|
75
|
+
"value": "Declare an XML namespace using xmlns attribute."
|
|
76
|
+
},
|
|
77
|
+
"insertText": "xmlns:${1:prefix}=\"${2:http://example.com/ns}\"",
|
|
78
|
+
"insertTextRules": 4,
|
|
79
|
+
"sortText": "01_xmlns"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"label": "DOCTYPE",
|
|
83
|
+
"kind": 15,
|
|
84
|
+
"detail": "Document type declaration",
|
|
85
|
+
"documentation": {
|
|
86
|
+
"value": "Declare the document type and optional DTD reference."
|
|
87
|
+
},
|
|
88
|
+
"insertText": "<!DOCTYPE ${1:root} SYSTEM \"${2:file.dtd}\">",
|
|
89
|
+
"insertTextRules": 4,
|
|
90
|
+
"sortText": "01_doctype"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"label": "processing instruction",
|
|
94
|
+
"kind": 15,
|
|
95
|
+
"detail": "Processing instruction",
|
|
96
|
+
"documentation": {
|
|
97
|
+
"value": "An XML processing instruction for application-specific data."
|
|
98
|
+
},
|
|
99
|
+
"insertText": "<?${1:target} ${2:data}?>",
|
|
100
|
+
"insertTextRules": 4,
|
|
101
|
+
"sortText": "02_pi"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"label": "pom.xml",
|
|
105
|
+
"kind": 15,
|
|
106
|
+
"detail": "Maven POM template",
|
|
107
|
+
"documentation": {
|
|
108
|
+
"value": "Basic Maven pom.xml project structure."
|
|
109
|
+
},
|
|
110
|
+
"insertText": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n <modelVersion>4.0.0</modelVersion>\n <groupId>${1:com.example}</groupId>\n <artifactId>${2:my-app}</artifactId>\n <version>${3:1.0-SNAPSHOT}</version>\n</project>",
|
|
111
|
+
"insertTextRules": 4,
|
|
112
|
+
"sortText": "03_pom"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"label": "dependency (Maven)",
|
|
116
|
+
"kind": 15,
|
|
117
|
+
"detail": "Maven dependency",
|
|
118
|
+
"documentation": {
|
|
119
|
+
"value": "Add a Maven dependency block."
|
|
120
|
+
},
|
|
121
|
+
"insertText": "<dependency>\n <groupId>${1:com.example}</groupId>\n <artifactId>${2:library}</artifactId>\n <version>${3:1.0.0}</version>\n</dependency>",
|
|
122
|
+
"insertTextRules": 4,
|
|
123
|
+
"sortText": "03_dep"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"label": "web.xml servlet",
|
|
127
|
+
"kind": 15,
|
|
128
|
+
"detail": "Servlet mapping",
|
|
129
|
+
"documentation": {
|
|
130
|
+
"value": "Java web.xml servlet mapping configuration."
|
|
131
|
+
},
|
|
132
|
+
"insertText": "<servlet>\n <servlet-name>${1:myServlet}</servlet-name>\n <servlet-class>${2:com.example.MyServlet}</servlet-class>\n</servlet>\n<servlet-mapping>\n <servlet-name>${1:myServlet}</servlet-name>\n <url-pattern>${3:/api/*}</url-pattern>\n</servlet-mapping>",
|
|
133
|
+
"insertTextRules": 4,
|
|
134
|
+
"sortText": "03_servlet"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"label": "XPath expression",
|
|
138
|
+
"kind": 15,
|
|
139
|
+
"detail": "XPath",
|
|
140
|
+
"documentation": {
|
|
141
|
+
"value": "Common XPath expression patterns."
|
|
142
|
+
},
|
|
143
|
+
"insertText": "//${1:element}[@${2:attr}='${3:value}']",
|
|
144
|
+
"insertTextRules": 4,
|
|
145
|
+
"sortText": "04_xpath"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"label": "XSLT stylesheet",
|
|
149
|
+
"kind": 15,
|
|
150
|
+
"detail": "XSLT template",
|
|
151
|
+
"documentation": {
|
|
152
|
+
"value": "Basic XSLT stylesheet structure."
|
|
153
|
+
},
|
|
154
|
+
"insertText": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n <xsl:template match=\"/\">\n ${1:<!-- transform -->}\n </xsl:template>\n</xsl:stylesheet>",
|
|
155
|
+
"insertTextRules": 4,
|
|
156
|
+
"sortText": "04_xslt"
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
{
|
|
2
|
+
"language": "zsh",
|
|
3
|
+
"completions": [
|
|
4
|
+
{
|
|
5
|
+
"label": "shebang",
|
|
6
|
+
"kind": 15,
|
|
7
|
+
"detail": "Zsh shebang",
|
|
8
|
+
"documentation": {
|
|
9
|
+
"value": "Zsh script shebang line."
|
|
10
|
+
},
|
|
11
|
+
"insertText": "#!/usr/bin/env zsh",
|
|
12
|
+
"insertTextRules": 4,
|
|
13
|
+
"sortText": "00_shebang"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"label": "alias",
|
|
17
|
+
"kind": 15,
|
|
18
|
+
"detail": "Alias",
|
|
19
|
+
"documentation": {
|
|
20
|
+
"value": "Define a command alias."
|
|
21
|
+
},
|
|
22
|
+
"insertText": "alias ${1:name}='${2:command}'",
|
|
23
|
+
"insertTextRules": 4,
|
|
24
|
+
"sortText": "00_alias"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"label": "function",
|
|
28
|
+
"kind": 15,
|
|
29
|
+
"detail": "Function",
|
|
30
|
+
"documentation": {
|
|
31
|
+
"value": "Define a shell function."
|
|
32
|
+
},
|
|
33
|
+
"insertText": "${1:fname}() {\n ${2:# body}\n}",
|
|
34
|
+
"insertTextRules": 4,
|
|
35
|
+
"sortText": "00_func"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"label": "export",
|
|
39
|
+
"kind": 15,
|
|
40
|
+
"detail": "Export variable",
|
|
41
|
+
"documentation": {
|
|
42
|
+
"value": "Export an environment variable."
|
|
43
|
+
},
|
|
44
|
+
"insertText": "export ${1:NAME}=\"${2:value}\"",
|
|
45
|
+
"insertTextRules": 4,
|
|
46
|
+
"sortText": "00_export"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"label": "if",
|
|
50
|
+
"kind": 15,
|
|
51
|
+
"detail": "If statement",
|
|
52
|
+
"documentation": {
|
|
53
|
+
"value": "Conditional if statement."
|
|
54
|
+
},
|
|
55
|
+
"insertText": "if [[ ${1:condition} ]]; then\n ${2:# commands}\nfi",
|
|
56
|
+
"insertTextRules": 4,
|
|
57
|
+
"sortText": "01_if"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"label": "if-else",
|
|
61
|
+
"kind": 15,
|
|
62
|
+
"detail": "If-else",
|
|
63
|
+
"documentation": {
|
|
64
|
+
"value": "If-else conditional."
|
|
65
|
+
},
|
|
66
|
+
"insertText": "if [[ ${1:condition} ]]; then\n ${2:# true branch}\nelse\n ${3:# false branch}\nfi",
|
|
67
|
+
"insertTextRules": 4,
|
|
68
|
+
"sortText": "01_ifelse"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"label": "for loop",
|
|
72
|
+
"kind": 15,
|
|
73
|
+
"detail": "For loop",
|
|
74
|
+
"documentation": {
|
|
75
|
+
"value": "Iterate over a list of items."
|
|
76
|
+
},
|
|
77
|
+
"insertText": "for ${1:item} in ${2:items}; do\n ${3:echo \"$item\"}\ndone",
|
|
78
|
+
"insertTextRules": 4,
|
|
79
|
+
"sortText": "01_for"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"label": "while loop",
|
|
83
|
+
"kind": 15,
|
|
84
|
+
"detail": "While loop",
|
|
85
|
+
"documentation": {
|
|
86
|
+
"value": "Loop while condition is true."
|
|
87
|
+
},
|
|
88
|
+
"insertText": "while [[ ${1:condition} ]]; do\n ${2:# commands}\ndone",
|
|
89
|
+
"insertTextRules": 4,
|
|
90
|
+
"sortText": "01_while"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"label": "case",
|
|
94
|
+
"kind": 15,
|
|
95
|
+
"detail": "Case statement",
|
|
96
|
+
"documentation": {
|
|
97
|
+
"value": "Pattern matching case statement."
|
|
98
|
+
},
|
|
99
|
+
"insertText": "case ${1:$var} in\n ${2:pattern1})\n ${3:# commands}\n ;;\n *)\n ${4:# default}\n ;;\nesac",
|
|
100
|
+
"insertTextRules": 4,
|
|
101
|
+
"sortText": "01_case"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"label": "PATH append",
|
|
105
|
+
"kind": 15,
|
|
106
|
+
"detail": "Add to PATH",
|
|
107
|
+
"documentation": {
|
|
108
|
+
"value": "Append a directory to PATH."
|
|
109
|
+
},
|
|
110
|
+
"insertText": "export PATH=\"${1:$HOME/.local/bin}:$PATH\"",
|
|
111
|
+
"insertTextRules": 4,
|
|
112
|
+
"sortText": "02_path"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"label": "source plugin",
|
|
116
|
+
"kind": 15,
|
|
117
|
+
"detail": "Source a plugin",
|
|
118
|
+
"documentation": {
|
|
119
|
+
"value": "Source a zsh plugin file."
|
|
120
|
+
},
|
|
121
|
+
"insertText": "source ${1:$ZSH/plugins/${2:git}/${2:git}.plugin.zsh}",
|
|
122
|
+
"insertTextRules": 4,
|
|
123
|
+
"sortText": "02_source"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"label": "autoload",
|
|
127
|
+
"kind": 15,
|
|
128
|
+
"detail": "Autoload function",
|
|
129
|
+
"documentation": {
|
|
130
|
+
"value": "Autoload a zsh function."
|
|
131
|
+
},
|
|
132
|
+
"insertText": "autoload -Uz ${1:compinit} && ${1:compinit}",
|
|
133
|
+
"insertTextRules": 4,
|
|
134
|
+
"sortText": "02_autoload"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"label": "setopt",
|
|
138
|
+
"kind": 14,
|
|
139
|
+
"detail": "Set option",
|
|
140
|
+
"documentation": {
|
|
141
|
+
"value": "Enable a zsh option."
|
|
142
|
+
},
|
|
143
|
+
"insertText": "setopt ${1:AUTO_CD}",
|
|
144
|
+
"insertTextRules": 4,
|
|
145
|
+
"sortText": "03_setopt"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"label": "bindkey",
|
|
149
|
+
"kind": 14,
|
|
150
|
+
"detail": "Key binding",
|
|
151
|
+
"documentation": {
|
|
152
|
+
"value": "Bind a key sequence to a widget."
|
|
153
|
+
},
|
|
154
|
+
"insertText": "bindkey '${1:^R}' ${2:history-incremental-search-backward}",
|
|
155
|
+
"insertTextRules": 4,
|
|
156
|
+
"sortText": "03_bindkey"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"label": "zstyle",
|
|
160
|
+
"kind": 14,
|
|
161
|
+
"detail": "Completion style",
|
|
162
|
+
"documentation": {
|
|
163
|
+
"value": "Configure completion system styling."
|
|
164
|
+
},
|
|
165
|
+
"insertText": "zstyle ':completion:*' ${1:menu} ${2:select}",
|
|
166
|
+
"insertTextRules": 4,
|
|
167
|
+
"sortText": "03_zstyle"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"label": "PROMPT",
|
|
171
|
+
"kind": 15,
|
|
172
|
+
"detail": "Custom prompt",
|
|
173
|
+
"documentation": {
|
|
174
|
+
"value": "Set custom prompt."
|
|
175
|
+
},
|
|
176
|
+
"insertText": "PROMPT='%F{${1:green}}%n@%m%f:%F{${2:blue}}%~%f$ '",
|
|
177
|
+
"insertTextRules": 4,
|
|
178
|
+
"sortText": "04_prompt"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"label": "oh-my-zsh",
|
|
182
|
+
"kind": 15,
|
|
183
|
+
"detail": "Oh My Zsh config",
|
|
184
|
+
"documentation": {
|
|
185
|
+
"value": "Basic Oh My Zsh configuration."
|
|
186
|
+
},
|
|
187
|
+
"insertText": "export ZSH=\"$HOME/.oh-my-zsh\"\nZSH_THEME=\"${1:robbyrussell}\"\nplugins=(${2:git docker kubectl})\nsource $ZSH/oh-my-zsh.sh",
|
|
188
|
+
"insertTextRules": 4,
|
|
189
|
+
"sortText": "05_omz"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"label": "zinit plugin",
|
|
193
|
+
"kind": 15,
|
|
194
|
+
"detail": "Zinit plugin load",
|
|
195
|
+
"documentation": {
|
|
196
|
+
"value": "Load a plugin with Zinit."
|
|
197
|
+
},
|
|
198
|
+
"insertText": "zinit light ${1:zsh-users/zsh-autosuggestions}",
|
|
199
|
+
"insertTextRules": 4,
|
|
200
|
+
"sortText": "05_zinit"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"label": "completion function",
|
|
204
|
+
"kind": 15,
|
|
205
|
+
"detail": "Custom completion",
|
|
206
|
+
"documentation": {
|
|
207
|
+
"value": "Define a custom completion function."
|
|
208
|
+
},
|
|
209
|
+
"insertText": "_${1:mycommand}() {\n local -a opts\n opts=(\n '${2:option1}:${3:description}'\n )\n _describe 'command' opts\n}\ncompdef _${1:mycommand} ${1:mycommand}",
|
|
210
|
+
"insertTextRules": 4,
|
|
211
|
+
"sortText": "05_compdef"
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
{
|
|
2
|
+
"language": "awk",
|
|
3
|
+
"definitions": {
|
|
4
|
+
"$0": {
|
|
5
|
+
"signature": "$0",
|
|
6
|
+
"description": "The entire current input record (line).",
|
|
7
|
+
"type": "variable",
|
|
8
|
+
"module": "awk"
|
|
9
|
+
},
|
|
10
|
+
"$1_$N": {
|
|
11
|
+
"signature": "$1, $2, ... $NF",
|
|
12
|
+
"description": "Individual fields of the current record. $1 is the first field, $NF is the last.",
|
|
13
|
+
"type": "variable",
|
|
14
|
+
"module": "awk"
|
|
15
|
+
},
|
|
16
|
+
"NR": {
|
|
17
|
+
"signature": "NR",
|
|
18
|
+
"description": "Number of Records - the current line number across all files.",
|
|
19
|
+
"type": "variable",
|
|
20
|
+
"module": "awk"
|
|
21
|
+
},
|
|
22
|
+
"NF": {
|
|
23
|
+
"signature": "NF",
|
|
24
|
+
"description": "Number of Fields in the current record.",
|
|
25
|
+
"type": "variable",
|
|
26
|
+
"module": "awk"
|
|
27
|
+
},
|
|
28
|
+
"FNR": {
|
|
29
|
+
"signature": "FNR",
|
|
30
|
+
"description": "File Number of Records - line number in the current file (resets per file).",
|
|
31
|
+
"type": "variable",
|
|
32
|
+
"module": "awk"
|
|
33
|
+
},
|
|
34
|
+
"FS": {
|
|
35
|
+
"signature": "FS",
|
|
36
|
+
"description": "Field Separator for input. Default is whitespace. Set in BEGIN block or with -F flag.",
|
|
37
|
+
"type": "variable",
|
|
38
|
+
"module": "awk"
|
|
39
|
+
},
|
|
40
|
+
"OFS": {
|
|
41
|
+
"signature": "OFS",
|
|
42
|
+
"description": "Output Field Separator. Used by print when separating fields with comma.",
|
|
43
|
+
"type": "variable",
|
|
44
|
+
"module": "awk"
|
|
45
|
+
},
|
|
46
|
+
"RS": {
|
|
47
|
+
"signature": "RS",
|
|
48
|
+
"description": "Record Separator for input. Default is newline. Set to empty string for paragraph mode.",
|
|
49
|
+
"type": "variable",
|
|
50
|
+
"module": "awk"
|
|
51
|
+
},
|
|
52
|
+
"ORS": {
|
|
53
|
+
"signature": "ORS",
|
|
54
|
+
"description": "Output Record Separator. Default is newline.",
|
|
55
|
+
"type": "variable",
|
|
56
|
+
"module": "awk"
|
|
57
|
+
},
|
|
58
|
+
"BEGIN": {
|
|
59
|
+
"signature": "BEGIN { ... }",
|
|
60
|
+
"description": "Code executed once before reading any input. Used for initialization.",
|
|
61
|
+
"type": "pattern",
|
|
62
|
+
"module": "awk"
|
|
63
|
+
},
|
|
64
|
+
"END": {
|
|
65
|
+
"signature": "END { ... }",
|
|
66
|
+
"description": "Code executed once after all input is processed. Used for summaries and cleanup.",
|
|
67
|
+
"type": "pattern",
|
|
68
|
+
"module": "awk"
|
|
69
|
+
},
|
|
70
|
+
"print": {
|
|
71
|
+
"signature": "print expr1, expr2",
|
|
72
|
+
"description": "Output values separated by OFS, followed by ORS.",
|
|
73
|
+
"type": "builtin",
|
|
74
|
+
"module": "awk"
|
|
75
|
+
},
|
|
76
|
+
"printf": {
|
|
77
|
+
"signature": "printf fmt, expr1, ...",
|
|
78
|
+
"description": "Formatted output. Supports %s (string), %d (integer), %f (float), %x (hex).",
|
|
79
|
+
"type": "builtin",
|
|
80
|
+
"module": "awk"
|
|
81
|
+
},
|
|
82
|
+
"gsub": {
|
|
83
|
+
"signature": "gsub(regex, replacement [, target])",
|
|
84
|
+
"description": "Global substitution. Replace all matches with replacement in target (default $0).",
|
|
85
|
+
"type": "builtin",
|
|
86
|
+
"module": "awk"
|
|
87
|
+
},
|
|
88
|
+
"sub": {
|
|
89
|
+
"signature": "sub(regex, replacement [, target])",
|
|
90
|
+
"description": "Substitute first match of regex with replacement in target (default $0).",
|
|
91
|
+
"type": "builtin",
|
|
92
|
+
"module": "awk"
|
|
93
|
+
},
|
|
94
|
+
"split": {
|
|
95
|
+
"signature": "split(string, array [, separator])",
|
|
96
|
+
"description": "Split string into array elements by separator. Returns number of pieces.",
|
|
97
|
+
"type": "builtin",
|
|
98
|
+
"module": "awk"
|
|
99
|
+
},
|
|
100
|
+
"length": {
|
|
101
|
+
"signature": "length([string])",
|
|
102
|
+
"description": "Return length of string, or number of elements in array.",
|
|
103
|
+
"type": "builtin",
|
|
104
|
+
"module": "awk"
|
|
105
|
+
},
|
|
106
|
+
"substr": {
|
|
107
|
+
"signature": "substr(string, start [, length])",
|
|
108
|
+
"description": "Extract a substring. Positions are 1-indexed.",
|
|
109
|
+
"type": "builtin",
|
|
110
|
+
"module": "awk"
|
|
111
|
+
},
|
|
112
|
+
"match": {
|
|
113
|
+
"signature": "match(string, regex)",
|
|
114
|
+
"description": "Search string for regex. Sets RSTART and RLENGTH. Returns position or 0.",
|
|
115
|
+
"type": "builtin",
|
|
116
|
+
"module": "awk"
|
|
117
|
+
},
|
|
118
|
+
"getline": {
|
|
119
|
+
"signature": "getline [var] [< file]",
|
|
120
|
+
"description": "Read the next line from input, a file, or a command pipe.",
|
|
121
|
+
"type": "builtin",
|
|
122
|
+
"module": "awk"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|