| 📦 Turbo Go 3d7798b k33g 13h ago | 1 | # turbo-go snippets. |
| 2 | # |
| 3 | # Each [[snippet]] becomes one line of the Snippets menu. Snippets sharing a |
| 4 | # group appear together in a submenu of that name; one with no group goes into |
| 5 | # General. A snippet is inserted at the cursor, and every line after the |
| 6 | # first is indented to match the line you inserted it on. |
| 7 | # |
| 8 | # languages restricts a snippet to files of those kinds, by the names the |
| 9 | # editor uses: go, toml, markdown, javascript, html, bash. Leave it out and the |
| 10 | # snippet is offered everywhere. |
| 11 | # |
| 12 | # Your own snippets, shared across every project, go in: |
| 13 | # /Users/k33g/Library/Application Support/turbo-go/snippets.toml |
| 14 | |
| 15 | [[snippet]] |
| 16 | name = "if err != nil" |
| 17 | group = "Go" |
| 18 | languages = ["go"] |
| 19 | body = """ |
| 20 | if err != nil { |
| 21 | \treturn err |
| 22 | }""" |
| 23 | |
| 24 | [[snippet]] |
| 25 | name = "table test" |
| 26 | group = "Go" |
| 27 | languages = ["go"] |
| 28 | body = """ |
| 29 | for _, test := range tests { |
| 30 | \tt.Run(test.name, func(t *testing.T) { |
| 31 | \t}) |
| 32 | }""" |
| 33 | |
| 34 | [[snippet]] |
| 35 | name = "strict mode" |
| 36 | group = "Shell" |
| 37 | languages = ["bash"] |
| 38 | body = "set -euo pipefail" |
| 39 | |
| 40 | [[snippet]] |
| 41 | name = "details block" |
| 42 | group = "Markdown" |
| 43 | languages = ["markdown"] |
| 44 | body = """ |
| 45 | <details> |
| 46 | <summary></summary> |
| 47 | |
| 48 | </details>""" |
| 49 | |
| 50 | [[snippet]] |
| 51 | name = "TODO" |
| 52 | body = "TODO: " |
| 53 | |
| 54 | [[snippet]] |
| 55 | name = "Hello World" |
| 56 | body = """Hello |
| 57 | World |
| 58 | With Bob Morane |
| 59 | """ |
| 60 | |