| 📦 Turbo Golo d710c1b k33g 11h 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, Golo and Help, in that order: |
| 8 | |
| 9 | ``` |
| 10 | File Edit Search Run Code Options Window Snippets Golo Help |
| 11 | ``` |
| 12 | |
| 13 | A project's tools file can add menus of its own between Golo and Help; they are listed under [Project menus](#project-menus) below. |
| 14 | |
| 15 | ## File |
| 16 | |
| 17 | | Item | Shortcut | Needs a file | Effect | |
| 18 | | --- | --- | --- | --- | |
| 19 | | New | `F4` | | Open an empty untitled window | |
| 20 | | Open… | `F3` | | Open the file browser and open what is chosen | |
| 21 | | Save | `F2` | yes | Write the file; asks for a name if it has none | |
| 22 | | Save as… | | yes | Ask for a name and write to it, adopting that path | |
| 23 | | Close | `Ctrl-W` | yes | Close the current window, offering to save first | |
| 24 | | Exit | `Alt-X` | | Leave the editor, offering to save each modified file | |
| 25 | |
| 26 | ## Edit |
| 27 | |
| 28 | | Item | Shortcut | Needs a file | Effect | |
| 29 | | --- | --- | --- | --- | |
| 30 | | Undo | `Ctrl-Z` | yes | Revert the last change | |
| 31 | | 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. | |
| 32 | | Insert line | `Ctrl-N` | yes | Open a blank line above the cursor, leaving the cursor on its own text | |
| 33 | | 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. | |
| 34 | | Cut | `Shift-Del` | yes | Copy the selection to the clipboard and remove it | |
| 35 | | Copy | `Ctrl-Ins` | yes | Copy the selection to the clipboard | |
| 36 | | Paste | `Shift-Ins` | yes | Insert the clipboard, replacing the selection | |
| 37 | | Select all | `Ctrl-A` | yes | Select the whole file | |
| 38 | |
| 39 | The clipboard is shared between every window of one editor session. |
| 40 | |
| 41 | ## Search |
| 42 | |
| 43 | | Item | Shortcut | Needs a file | Effect | |
| 44 | | --- | --- | --- | --- | |
| 45 | | Find… | `Ctrl-F` | yes | Ask for text and options, then jump to the first match | |
| 46 | | Find next | `F7` | yes | Jump to the next match, wrapping round the end of the file | |
| 47 | | Find previous | `Shift-F7` | yes | Jump to the previous match, wrapping round the start | |
| 48 | | Go to line… | `Ctrl-G` | yes | Ask for a line number, counting from one | |
| 49 | |
| 50 | ## Run |
| 51 | |
| 52 | | Item | Shortcut | Needs a file | Effect | |
| 53 | | --- | --- | --- | --- | |
| 54 | | Completion | `Ctrl-Space` | yes | Open the completion list at the cursor | |
| 55 | | Language server status | | | Show whether a language server is running, and what it is doing | |
| 56 | |
| 57 | ## Code |
| 58 | |
| 59 | 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. |
| 60 | |
| 61 | Its hot key is `Alt-C`. |
| 62 | |
| 63 | The menu is the same in every editor of the family; the last column says what `golo lsp` — the interpreter in language-server mode — makes of each item. It advertises everything the menu asks for except `typeDefinition`, and the one item that asks for that reports nothing found rather than being hidden. |
| 64 | |
| 65 | | Item | Shortcut | Needs a file | Effect | With `golo lsp` | |
| 66 | | --- | --- | --- | --- | --- | |
| 67 | | Describe symbol | `F1` | yes | Show what the language server knows about the symbol under the cursor | Answered: the signature and documentation of a builtin or an imported symbol; the `#` comments above a function you declared | |
| 68 | | Go to definition | `F12` | yes | Where the symbol is declared. One answer opens it; several offer the list. | Answered, within the file: top-level functions and unions | |
| 69 | | Go to type definition | | yes | Where the *type* of the symbol is declared, which is a different question | Nothing found | |
| 70 | | Find implementations… | | yes | What implements it | Answered with the function's declaration, the same place Go to definition goes: Golo has no interfaces, so a function is its own implementation | |
| 71 | | Find references… | `Shift-F12` | yes | Where it is used, counting its declaration | Answered, within the file: the declaration and every call | |
| 72 | | Symbol in file… | | yes | The file's own outline, indented, with each symbol's kind. Choosing one goes to it. | Answered: top-level functions and unions, each union's variants nested under it | |
| 73 | | Symbol in project… | `Ctrl-T` | no | Ask for a name and search the whole project | Answered: the top-level functions, unions and module names of every `.golo` file under the project root, open or not; an empty name lists them all | |
| 74 | | Problems… | | no | Every problem the server has reported, for every file it has spoken about | Syntax errors, and lints for `:`/`.` confusion and C-style comments | |
| 75 | |
| 76 | A list of places shows the file, the line, and the text of that line — twelve entries reading `shapes.golo: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. |
| 77 | |
| 78 | 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. |
| 79 | |
| 80 | *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. |
| 81 | |
| 82 | ## Options |
| 83 | |
| 84 | | Item | Needs a file | Effect | |
| 85 | | --- | --- | --- | |
| 86 | | Theme… | | List every loadable theme and apply the one chosen, immediately. With a project settings file present, also writes the choice into it. | |
| 87 | | Line numbers | yes | Show or hide the gutter in the current window | |
| 88 | | Create project settings | | Write `.turbo-golo/settings.toml` with the theme in use, and open it. **Greyed out once the project has one.** | |
| 89 | | Project settings… | | Open `.turbo-golo/settings.toml`. **Greyed out until the project has one.** | |
| 90 | |
| 91 | ## Window |
| 92 | |
| 93 | | Item | Shortcut | Needs a file | Effect | |
| 94 | | --- | --- | --- | --- | |
| 95 | | Next | `F6` | yes | Bring the window behind the current one forward | |
| 96 | | New terminal | `F8` | no | Open a window running a shell, in the directory of the file in front | |
| 97 | | Project tree | `F9` | no | Open a window showing the project's files; brings the existing one forward when there is one | |
| 98 | | Tile | | yes | Lay every window out in a grid, none overlapping | |
| 99 | | Cascade | | yes | Stack the windows offset, every title visible | |
| 100 | | 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. | |
| 101 | | List… | `Alt-0` | yes | List the open windows and bring the chosen one forward | |
| 102 | |
| 103 | ## Snippets |
| 104 | |
| 105 | Built from `.turbo-golo/snippets.toml` and your own snippets file each time it opens. Its hot key is `Alt-N`, because Search already answers to S. |
| 106 | |
| 107 | | Item | Needs a file | Effect | |
| 108 | | --- | --- | --- | |
| 109 | | One submenu per group | | Insert the chosen snippet at the cursor; the items need a file open | |
| 110 | | Create snippets file | no | Write `.turbo-golo/snippets.toml` with worked examples — twelve Golo constructs, a general one and a Markdown one — then open it. **Greyed out once the project has one.** | |
| 111 | | Open snippets file | no | Open `.turbo-golo/snippets.toml`. **Greyed out until the project has one.** Always the project's file, never your own. | |
| 112 | |
| 113 | See [Snippets](snippets.md). |
| 114 | |
| 115 | ## Golo |
| 116 | |
| 117 | Built from `.turbo-golo/tools.toml` each time it opens. Its hot key is `Alt-G`. |
| 118 | |
| 119 | | Item | Effect | |
| 120 | | --- | --- | |
| 121 | | 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 | |
| 122 | | Create tools file | Write `.turbo-golo/tools.toml` with the starter commands — Run, Test, Test one, Debug, REPL, New script, Build native and Build wasm in this menu, and an Echo in a menu called Tools — then open it. **Greyed out once the project has one.** | |
| 123 | | Open tools file | Open `.turbo-golo/tools.toml`. **Greyed out until the project has one.** | |
| 124 | |
| 125 | See [Golo tools](golo-tools.md). |
| 126 | |
| 127 | ## Project menus |
| 128 | |
| 129 | Not fixed: one menu per `menu` name in `.turbo-golo/tools.toml`, in the order the names first appear there, between Golo and Help. A project with no tools file, or whose tools all stay in Golo, has none; the starter tools file makes one, called **Tools**. |
| 130 | |
| 131 | | Item | Effect | |
| 132 | | --- | --- | |
| 133 | | One line per tool naming that menu | Run that command, showing its output where the tool asked | |
| 134 | |
| 135 | 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 [Golo tools](golo-tools.md#hot-keys). |
| 136 | |
| 137 | ## Help |
| 138 | |
| 139 | | Item | Effect | |
| 140 | | --- | --- | |
| 141 | | Keyboard | Show the keys worth knowing | |
| 142 | | About | Show the version, the commit and build date when the build recorded them, and the current theme. See [the version number](versioning.md). | |
| 143 | |
| 144 | ## Status bar |
| 145 | |
| 146 | The hints along the bottom are clickable and run the same actions. |
| 147 | |
| 148 | | Hint | Action | |
| 149 | | --- | --- | |
| 150 | | `F1 Describe` | Code ▸ Describe symbol | |
| 151 | | `F2 Save` | File ▸ Save | |
| 152 | | `F3 Open` | File ▸ Open… | |
| 153 | | `F6 Window` | Window ▸ Next | |
| 154 | | `F7 Next` | Search ▸ Find next | |
| 155 | | `F10 Menu` | Open the menu bar | |
| 156 | | `Alt-X Exit` | File ▸ Exit | |
| 157 | |
| 158 | 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 — `LSP: starting…`, `LSP: ready`, `LSP: off`, or `LSP: no golo — see https://codeberg.org/TypeUnsafe/golo-script/releases` when the interpreter cannot be found. |