| 📦 Turbo Go 3d7798b k33g 9h ago | 1 | # Reference: menus |
| 2 | |
| 3 | > Complete list of the menu bar's entries, with their shortcuts and the conditions under which they can be chosen. |
| 4 | |
| 5 | An item marked **needs a file** is greyed out when no window is open. |
| 6 | |
| 7 | The bar always holds File, Edit, Search, Run, Code, Options, Window, Snippets, Go and Help, in that order. A project's tools file can add menus of its own between Go and Help; they are listed under [Project menus](#project-menus) below. |
| 8 | |
| 9 | ## File |
| 10 | |
| 11 | | Item | Shortcut | Needs a file | Effect | |
| 12 | | --- | --- | --- | --- | |
| 13 | | New | `F4` | | Open an empty untitled window | |
| 14 | | Open… | `F3` | | Open the file browser and open what is chosen | |
| 15 | | Save | `F2` | yes | Write the file; asks for a name if it has none | |
| 16 | | Save as… | | yes | Ask for a name and write to it, adopting that path | |
| 17 | | Close | `Ctrl-W` | yes | Close the current window, offering to save first | |
| 18 | | Exit | `Alt-X` | | Leave the editor, offering to save each modified file | |
| 19 | |
| 20 | ## Edit |
| 21 | |
| 22 | | Item | Shortcut | Needs a file | Effect | |
| 23 | | --- | --- | --- | --- | |
| 24 | | Undo | `Ctrl-Z` | yes | Revert the last change | |
| 25 | | Redo | `Ctrl-R` | yes | Re-apply the last undone change. **`Ctrl-Y` used to do this**; it deletes a line now, as it did in Turbo C. | |
| 26 | | Insert line | `Ctrl-N` | yes | Open a blank line above the cursor, leaving the cursor on its own text | |
| 27 | | Delete line | `Ctrl-Y` | yes | Remove the line the cursor is on. The cursor stays on the same line number, so holding the key deletes a run. | |
| 28 | | Cut | `Shift-Del` | yes | Copy the selection to the clipboard and remove it | |
| 29 | | Copy | `Ctrl-Ins` | yes | Copy the selection to the clipboard | |
| 30 | | Paste | `Shift-Ins` | yes | Insert the clipboard, replacing the selection | |
| 31 | | Select all | `Ctrl-A` | yes | Select the whole file | |
| 32 | |
| 33 | The clipboard is shared between every window of one editor session. |
| 34 | |
| 35 | ## Search |
| 36 | |
| 37 | | Item | Shortcut | Needs a file | Effect | |
| 38 | | --- | --- | --- | --- | |
| 39 | | Find… | `Ctrl-F` | yes | Ask for text and options, then jump to the first match | |
| 40 | | Find next | `F7` | yes | Jump to the next match, wrapping round the end of the file | |
| 41 | | Find previous | `Shift-F7` | yes | Jump to the previous match, wrapping round the start | |
| 42 | | Go to line… | `Ctrl-G` | yes | Ask for a line number, counting from one | |
| 43 | |
| 44 | ## Run |
| 45 | |
| 46 | | Item | Shortcut | Needs a file | Effect | |
| 47 | | --- | --- | --- | --- | |
| 48 | | Completion | `Ctrl-Space` | yes | Open the completion list at the cursor | |
| 49 | | Language server status | | | Show whether a language server is running, and what it is doing | |
| 50 | |
| 51 | ## Code |
| 52 | |
| 53 | Everything the editor asks the language server about the symbol **under the cursor**. Nothing here needs a selection: almost every request in the protocol takes a position rather than a range, so there is nothing extra to say by selecting first. |
| 54 | |
| 55 | Its hot key is `Alt-C`. |
| 56 | |
| 57 | | Item | Shortcut | Needs a file | Effect | |
| 58 | | --- | --- | --- | --- | |
| 59 | | Describe symbol | `F1` | yes | Show what the language server knows about the symbol under the cursor | |
| 60 | | Go to definition | `F12` | yes | Where the symbol is declared. One answer opens it; several offer the list. | |
| 61 | | Go to type definition | | yes | Where the *type* of the symbol is declared, which is a different question | |
| 62 | | Find implementations… | | yes | What implements it: the types satisfying an interface, the impl blocks of a trait | |
| 63 | | Find references… | `Shift-F12` | yes | Where it is used, counting its declaration | |
| 64 | | Symbol in file… | | yes | The file's own outline, indented, with each symbol's kind. Choosing one goes to it. | |
| 65 | | Symbol in project… | `Ctrl-T` | no | Ask for a name and search the whole project | |
| 66 | | Problems… | | no | Every problem the server has reported, for every file it has spoken about | |
| 67 | |
| 68 | A list of places shows the file, the line, and the text of that line — twelve entries reading `handler.go:42` say nothing about which one you want. The text comes from an open window when there is one, so a file edited and not saved is listed as it now reads. |
| 69 | |
| 70 | Three answers are told apart, and the difference matters: **nothing found** says so in the question's own words (`No references found`), **the server is not ready** shows what it is doing instead, and **one answer** simply takes you there without a dialog. |
| 71 | |
| 72 | *Symbol in file* has no shortcut on purpose. The obvious one is `Ctrl-Shift-O`, and a terminal cannot tell that from `Ctrl-O` — the shift is lost before the editor sees it. |
| 73 | |
| 74 | ## Options |
| 75 | |
| 76 | | Item | Needs a file | Effect | |
| 77 | | --- | --- | --- | |
| 78 | | Theme… | | List every loadable theme and apply the one chosen, immediately. With a project settings file present, also writes the choice into it. | |
| 79 | | Line numbers | yes | Show or hide the gutter in the current window | |
| 80 | | Create project settings | | Write `.turbo-go/settings.toml` with the theme in use, and open it. **Greyed out once the project has one.** | |
| 81 | | Project settings… | | Open `.turbo-go/settings.toml`. **Greyed out until the project has one.** | |
| 82 | |
| 83 | ## Window |
| 84 | |
| 85 | | Item | Shortcut | Needs a file | Effect | |
| 86 | | --- | --- | --- | --- | |
| 87 | | Next | `F6` | yes | Bring the window behind the current one forward | |
| 88 | | New terminal | `F8` | no | Open a window running a shell, in the directory of the file in front | |
| 89 | | Project tree | `F9` | no | Open a window showing the project's files; brings the existing one forward when there is one | |
| 90 | | Tile | | yes | Lay every window out in a grid, none overlapping | |
| 91 | | Cascade | | yes | Stack the windows offset, every title visible | |
| 92 | | Maximise | | yes | Give the current window the whole desktop, or put it back where it was if it already has it. The same toggle as the `[■]` box on the window's own frame. | |
| 93 | | List… | `Alt-0` | yes | List the open windows and bring the chosen one forward | |
| 94 | |
| 95 | ## Snippets |
| 96 | |
| 97 | Built from `.turbo-go/snippets.toml` and your own snippets file each time it opens. Its hot key is `Alt-N`, because Search already answers to S. |
| 98 | |
| 99 | | Item | Needs a file | Effect | |
| 100 | | --- | --- | --- | |
| 101 | | One submenu per group | | Insert the chosen snippet at the cursor; the items need a file open | |
| 102 | | Create snippets file | no | Write `.turbo-go/snippets.toml` with worked examples, then open it. **Greyed out once the project has one.** | |
| 103 | | Open snippets file | no | Open `.turbo-go/snippets.toml`. **Greyed out until the project has one.** Always the project's file, never your own. | |
| 104 | |
| 105 | See [Snippets](snippets.md). |
| 106 | |
| 107 | ## Go |
| 108 | |
| 109 | Built from `.turbo-go/tools.toml` each time it opens. Its hot key is `Alt-G`. |
| 110 | |
| 111 | | Item | Effect | |
| 112 | | --- | --- | |
| 113 | | One line per tool that names no `menu` | Run that command, showing its output where the tool asked: a popup, a terminal window, or an editing window | |
| 114 | | Create tools file | Write `.turbo-go/tools.toml` with the five Go commands, then open it. **Greyed out once the project has one.** | |
| 115 | | Open tools file | Open `.turbo-go/tools.toml`. **Greyed out until the project has one.** | |
| 116 | |
| 117 | See [Go tools](go-tools.md). |
| 118 | |
| 119 | ## Project menus |
| 120 | |
| 121 | Not fixed: one menu per `menu` name in `.turbo-go/tools.toml`, in the order the names first appear there, between Go and Help. A project with no tools file, or whose tools all stay in Go, has none. |
| 122 | |
| 123 | | Item | Effect | |
| 124 | | --- | --- | |
| 125 | | One line per tool naming that menu | Run that command, showing its output where the tool asked | |
| 126 | |
| 127 | Their hot keys are assigned rather than fixed, so that a name from a file can never take a letter one of the menus above already answers to. The rules are in [Go tools](go-tools.md#hot-keys). |
| 128 | |
| 129 | ## Help |
| 130 | |
| 131 | | Item | Effect | |
| 132 | | --- | --- | |
| 133 | | Keyboard | Show the keys worth knowing | |
| 134 | | About | Show the version, the commit and build date when the build recorded them, and the current theme. See [the version number](versioning.md). | |
| 135 | |
| 136 | ## Status bar |
| 137 | |
| 138 | The hints along the bottom are clickable and run the same actions. |
| 139 | |
| 140 | | Hint | Action | |
| 141 | | --- | --- | |
| 142 | | `F1 Describe` | Code ▸ Describe symbol | |
| 143 | | `F2 Save` | File ▸ Save | |
| 144 | | `F3 Open` | File ▸ Open… | |
| 145 | | `F6 Window` | Window ▸ Next | |
| 146 | | `F7 Next` | Search ▸ Find next | |
| 147 | | `F10 Menu` | Open the menu bar | |
| 148 | | `Alt-X Exit` | File ▸ Exit | |
| 149 | |
| 150 | The right-hand end shows, in this order: the cursor as `line:column`, then either the first error the language server reported for this file (prefixed `⚠`) or the language server's state. |