| 📦 Turbo Go 3d7798b k33g 10h ago | 1 | # turbo-go tools. |
| 2 | # |
| 3 | # Each [[tool]] becomes one line of the Go menu, in the order they appear here. |
| 4 | # name is what the menu shows; a letter between tildes is its hot key, and no |
| 5 | # two tools should claim the same one. |
| 6 | # |
| 7 | # command goes to "sh -c", so pipes, globs and && work: one entry can be a |
| 8 | # whole sequence. |
| 9 | # |
| 10 | # menu says which menu it appears in. Leave it out and the tool goes into the Go |
| 11 | # menu; name anything else and that menu is created for you, in the order the |
| 12 | # names first appear here. A tool that has nothing to do with Go belongs in one |
| 13 | # of your own: |
| 14 | # |
| 15 | # [[tool]] |
| 16 | # name = "~E~cho" |
| 17 | # command = "echo TADA" |
| 18 | # menu = "Tools" |
| 19 | # |
| 20 | # A {{label}} in a command is a value the editor asks for before running it, in |
| 21 | # a box titled after the tool. The text between the braces is what it asks for: |
| 22 | # |
| 23 | # [[tool]] |
| 24 | # name = "~I~nit module" |
| 25 | # command = "go mod init {{module path}}" |
| 26 | # |
| 27 | # The value is quoted, so a path with a space in it stays one argument. Add ... |
| 28 | # inside the braces when you mean several arguments rather than one value: |
| 29 | # |
| 30 | # [[tool]] |
| 31 | # name = "Test ~o~ne" |
| 32 | # command = "go test {{extra flags...}} ./..." |
| 33 | # |
| 34 | # Double braces, not single. Single ones appear in real commands — awk '{print |
| 35 | # $1}' and find . -exec rm {} + are both ordinary things to put here — and |
| 36 | # neither is asking you for anything. |
| 37 | # |
| 38 | # output says where what the command prints goes: |
| 39 | # popup a dialog that fills in as it runs, and says the exit code (default) |
| 40 | # terminal a terminal window, for anything that reads the keyboard or runs long |
| 41 | # editor an editing window once it has finished, to search with Ctrl-F |
| 42 | # |
| 43 | # Commands run in the directory the editor was started in, which is why ./... |
| 44 | # means the whole module when you start from the project root. |
| 45 | |
| 46 | [[tool]] |
| 47 | name = "~F~ormat" |
| 48 | command = "gofmt -l -w ." |
| 49 | output = "popup" |
| 50 | |
| 51 | [[tool]] |
| 52 | name = "~L~int" |
| 53 | command = "go vet ./..." |
| 54 | output = "popup" |
| 55 | |
| 56 | [[tool]] |
| 57 | name = "~B~uild" |
| 58 | command = "go build ./..." |
| 59 | output = "popup" |
| 60 | |
| 61 | [[tool]] |
| 62 | name = "~T~est" |
| 63 | command = "go test ./..." |
| 64 | output = "popup" |
| 65 | |
| 66 | [[tool]] |
| 67 | name = "~R~un" |
| 68 | command = "go run ." |
| 69 | # A terminal, not a popup: a program that reads the keyboard has to be able to |
| 70 | # be answered, and one that runs long has to be able to be interrupted. |
| 71 | output = "terminal" |
| 72 | |
| 73 | # A tool that asks for a value: {{double braces}} opens a box before it runs, |
| 74 | # and what you type is shell-quoted, so a name with a space stays one argument. |
| 75 | |
| 76 | [[tool]] |
| 77 | name = "~G~rep" |
| 78 | command = "grep -rn {{pattern}} --include='*.go' ." |
| 79 | output = "editor" |
| 80 | |
| 81 | [[tool]] |
| 82 | name = "~I~nit module" |
| 83 | command = "go mod init {{module path}}" |
| 84 | output = "popup" |
| 85 | |
| 86 | # A tool naming a `menu` gets a menu of its own on the bar. Nothing here does, |
| 87 | # so every tool below is in the Go menu. Add `menu = "Doc~k~er"` to one and a |
| 88 | # Docker menu appears between Go and Help — that is the whole mechanism. |
| 89 | |
| 90 | [[tool]] |
| 91 | name = "~E~cho" |
| 92 | command = "echo 🎉 tada!" |
| 93 | menu = "Tools" |
| 94 | output = "terminal" |