Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
fdeb37f
feat: add f* snippets
Apr 30, 2023
32f8300
feat: add g* snippets
Apr 30, 2023
3f6d53b
fix: remove redundant quote
Apr 30, 2023
0cda060
feat: permit list all duration suffixes
Apr 30, 2023
8b9e7a0
feat: snippets for h* commands
Apr 30, 2023
edee13e
feat: forbid snippet grouping
Apr 30, 2023
a80fb6e
feat: add i* snippets
Apr 30, 2023
09e26bf
feat: add j* snippets
Apr 30, 2023
d11b69c
feat: add k* snippets
Apr 30, 2023
2c7d3b9
feat: add l* snippets
Apr 30, 2023
9505ba6
feat: permit listing all subcommands in placeholders
Apr 30, 2023
e46811a
feat: force snippet grouping
Apr 30, 2023
af58468
feat: add `lines` snippet
Apr 30, 2023
868241b
feat: add remaining l* snippets
Apr 30, 2023
6683674
feat: add m* snippets
Apr 30, 2023
b17f678
feat: add n* aliases
Apr 30, 2023
1546474
feat: add o* snippets
Apr 30, 2023
0a2624f
feat: add p* snippets
Apr 30, 2023
97d2192
feat: clarify when to group snippets
Apr 30, 2023
70dc737
feat: clean-up snippets
Apr 30, 2023
1b2d489
fix: remove redundant snippet
Apr 30, 2023
ed46793
feat: add r* snippets
Apr 30, 2023
25a19b2
feat: use pipe for `open`
Apr 30, 2023
8f61349
feat: fix placeholder name for `open`
Apr 30, 2023
fbb2ddc
feat: prefer pipes always
Apr 30, 2023
5b995c0
fix: rename filesize snippet
Apr 30, 2023
9c5b370
feat: fix placeholder for `last`
Apr 30, 2023
e668201
feat: add s* snippets
Apr 30, 2023
baba1dc
feat: add t* snippets
Apr 30, 2023
7a0c4c8
feat: add u* snippets
Apr 30, 2023
c7000d3
feat: add v* snippets
Apr 30, 2023
74f8636
feat: add w* snippets
Apr 30, 2023
b27e764
feat: add z* snippets
Apr 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 37 additions & 2 deletions snippets/convention.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ Snippets are only created for commands those satisfy at least one condition:
If there are options available for command or a subcommand then there is no
restriction about what options to pick to put in snippet definition.

Always prefer pipes over direct argument passing.

## Placeholders

Placeholders by default should describe what kind of value is expected like
Expand All @@ -41,5 +43,38 @@ then example value should be used like `${1:ff}`.
Placeholders can not to list all available choices like
`${1|big5,euc-jp,euc-kr,gbk,iso-8859-1,utf-16,cp1252,latin5|}`. When there are
more then 8 alternatives, provide the most common ones in terms of usage
frequency (it doesn't apply for `date` snippet and placeholders with data
types).
frequency (it doesn't apply for `date` snippet, data
types, durations and subcommands).

## Grouping

Always group snippets presenting different subcommands for the same command and
sharing the same set of options via placeholders with alternatives when there
is no snippet for this command without subcommands. Write this:

```json
{
"hash builtin": {
"prefix": "hash",
"description": "\"hash\" invocation",
"body": "${1:command} | hash ${2|md5,sha256|}"
}
}
```

instead of:

```json
{
"hash md5 builtin": {
"prefix": "hash-md5",
"description": "\"hash md5\" invocation",
"body": "${1:command} | hash md5"
},
"hash sha256 builtin": {
"prefix": "hash-sha256",
"description": "\"hash sha256\" invocation",
"body": "${1:command} | hash sha256"
}
}
```
Loading