| 📦 Turbo Go 3d7798b k33g 8h ago | 1 | # turbo-go |
| 2 | |
| 3 | A Turbo C-style editor for Go, written in Go. |
| 4 | |
| 5 | Built on **[turbo-core](https://rickub.com/turbo-editors/turbo-core)**, the library every Turbo editor shares. What is in this repository is the command, the profile that says this editor is for Go, and the Go scanner — about four hundred lines. Everything else lives in the library. |
| 6 | |
| 7 | A full-screen terminal IDE with the Borland furniture - a menu bar with hot keys, movable windows that cast shadows, modal dialogs, a clickable status bar — and the things a Go editor needs today: syntax colouring from the compiler's own tokeniser, loadable colour themes, completion from `gopls`, shell windows, per-project settings, a project tree, snippets, and the go toolchain a menu away. |
| 8 | |
| 9 | ``` |
| 10 | File Edit Search Run Options Window Help |
| 11 | ╔═[x]═════════════════════════════ greeter.go ══════════════════════════════1═[■]╗ |
| 12 | ║ 1 package main ▲║ |
| 13 | ║ 2 ▓║ |
| 14 | ║ 3 import "fmt" ░║ |
| 15 | ║ 4 ░║ |
| 16 | ║ 5 // Greeter says hello to whoever asks. ░║ |
| 17 | ║ 6 type Greeter struct { ░║ |
| 18 | ║ 7 Name string ░║ |
| 19 | ║ 8 Count int ░║ |
| 20 | ║ 9 } ▼║ |
| 21 | ║◄▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░►║ |
| 22 | ╚════════════════════════════════════════════════════════════════════════════════╝ |
| 23 | F1 Describe F2 Save F3 Open F6 Window F7 Next F10 Menu 1:1 LSP: ready |
| 24 | ``` |
| 25 | |
| 26 | ## Getting started |
| 27 | |
| 28 | ```bash |
| 29 | make install |
| 30 | ``` |
| 31 | |
| 32 | That builds the editor, puts it where your shell looks for commands, and reports what it found — the Go version, where the binary went, whether that directory is on your `PATH`, and whether `gopls` is installed. Then, from any Go project: |
| 33 | |
| 34 | ```bash |
| 35 | turbo-go main.go |
| 36 | ``` |
| 37 | |
| 38 | To build without installing, `make build` leaves the binary in `bin/turbo-go`. From the module proxy instead of a checkout: `go install rickub.com/turbo-editors/turbo-go@latest`. |
| 39 | |
| 40 | For completion, install the Go language server as well — the editor works without it, and says so on the status bar: |
| 41 | |
| 42 | ```bash |
| 43 | go install golang.org/x/tools/gopls@latest |
| 44 | ``` |
| 45 | |
| 46 | The [tutorial](docs/en/tutorials/getting-started.md) walks through a first session in about ten minutes. |
| 47 | |
| 48 | ## Features |
| 49 | |
| 50 | - **Every build knows what it is** — `turbo-go -version` and **Help ▸ About** name the version, the commit and the build date, stamped in by the linker from `git describe` rather than read from a constant somebody forgot to bump |
| 51 | - **Turbo Vision interface** — menu bar with `Alt`-letter hot keys, overlapping movable and resizable windows, modal dialogs, mouse support throughout |
| 52 | - **Syntax colouring for nine languages** — Go through `go/scanner`, so it is exactly as right as the compiler, plus TOML, Markdown, JavaScript, HTML and shell scripts from turbo-core, each with a small scanner of its own |
| 53 | - **Themes** in TOML, eleven embedded — Borland navy, dark grey, paper white, espresso, Catppuccin Frappé and Latte, cobalt, Darcula and IntelliJ Light, and a hueless monochrome in both polarities — and any number of your own, with inheritance between files and between style keys. Every shipped theme is held to its contrast by tests |
| 54 | - **Per-project settings** in `.turbo-go/settings.toml` — pin a theme, turn on automatic saving — created from a menu item and never by itself |
| 55 | - **Completion, hover and go-to-definition** from `gopls`, entirely optional |
| 56 | - **Terminal windows** — `F8` opens a real shell in a window, with its own VT/ANSI emulator, scrollback and job control (Linux, macOS and Windows) |
| 57 | - **Project tree** — `F9` shows the project's files in a window; walk it with the arrows and press Enter to open one |
| 58 | - **Snippets** — a `Snippets` menu built from `.turbo-go/snippets.toml`, grouped into submenus and filtered by the file you are in; the chosen text is inserted at the cursor, re-indented to match |
| 59 | - **The go toolchain a menu away** — `Alt-G` runs format, vet, build, test and run from `.turbo-go/tools.toml`, each showing its output where the tool asked: a popup that fills in as it goes, a terminal window, or an editing window to search. Files the command rewrote are re-read for you, and a tool naming a `menu` of its own gets that menu on the bar |
| 60 | - **Editing** with word movement, block indent, a shared clipboard, and undo that merges a run of typing into one step |
| 61 | - **Faithful files** — line endings and the trailing newline are preserved, and saving is atomic |
| 62 | - **Automatic saving**, off by default, writing a short while after you stop typing |
| 63 | |
| 64 | ## Commands |
| 65 | |
| 66 | | Command | What it does | |
| 67 | | --- | --- | |
| 68 | | `make install` | Build and install onto your `PATH` | |
| 69 | | `make build` | Compile into `bin/turbo-go` | |
| 70 | | `make test` | Run the whole test suite | |
| 71 | | `make check` | `fmt`, `vet`, then the tests — what a commit should pass | |
| 72 | | `make run FILE=x.go` | Build and start the editor on a file | |
| 73 | | `make help` | List every target | |
| 74 | |
| 75 | ```bash |
| 76 | turbo-go [-theme name] [-no-lsp] [file...] |
| 77 | turbo-go -list-themes |
| 78 | ``` |
| 79 | |
| 80 | ## Documentation |
| 81 | |
| 82 | Full documentation in **[English](docs/en/)** and **[French](docs/fr/)**, organised by the [Diátaxis](https://diataxis.fr) method: |
| 83 | |
| 84 | | | | |
| 85 | | --- | --- | |
| 86 | | **Tutorial** | [Your first file in Turbo Go](docs/en/tutorials/getting-started.md) | |
| 87 | | **How-to** | [install](docs/en/how-to/install.md) · [run the tests](docs/en/how-to/run-the-tests.md) · [enable completion](docs/en/how-to/enable-completion.md) · [write a theme](docs/en/how-to/write-a-theme.md) · [move around a file](docs/en/how-to/navigate-code.md) · [use a terminal](docs/en/how-to/use-a-terminal.md) · [configure a project](docs/en/how-to/configure-a-project.md) · [browse a project](docs/en/how-to/browse-a-project.md) · [use snippets](docs/en/how-to/use-snippets.md) · [run go commands](docs/en/how-to/run-go-commands.md) · [make a release](docs/en/how-to/make-a-release.md) | |
| 88 | | **Reference** | [command line](docs/en/reference/cli.md) · [keyboard](docs/en/reference/keyboard.md) · [menus](docs/en/reference/menus.md) · [theme format](docs/en/reference/themes.md) · [terminal windows](docs/en/reference/terminal.md) · [project settings](docs/en/reference/project-settings.md) · [project tree](docs/en/reference/project-tree.md) · [languages](docs/en/reference/languages.md) · [snippets](docs/en/reference/snippets.md) · [go tools](docs/en/reference/go-tools.md) · [the version number](docs/en/reference/versioning.md) | |
| 89 | | **Explanation** | [architecture](docs/en/explanation/architecture.md) · [design decisions](docs/en/explanation/design-decisions.md) · [colouring and completion](docs/en/explanation/colouring-and-completion.md) · [terminal windows](docs/en/explanation/terminal-windows.md) · [project settings](docs/en/explanation/project-settings.md) · [project tree](docs/en/explanation/project-tree.md) · [snippets](docs/en/explanation/snippets.md) · [go tools](docs/en/explanation/go-tools.md) | |
| 90 | |
| 91 | The library's packages each carry their own `README.md` beside the code, in [turbo-core](https://rickub.com/turbo-editors/turbo-core). |
| 92 | |
| 93 | ## Where the code is |
| 94 | |
| 95 | | | | |
| 96 | | --- | --- | |
| 97 | | `main.go` | flags, the terminal, the wiring | |
| 98 | | `internal/golang` | the profile, the Go scanner, the three starter files | |
| 99 | | everything else | [turbo-core](https://rickub.com/turbo-editors/turbo-core) | |
| 100 | |
| 101 | The dependency graph is drawn in [`docs/diagrams/packages.drawio`](docs/diagrams/packages.drawio), checked against `go list`. |
| 102 | |
| 103 | ## Design in one line |
| 104 | |
| 105 | Two dependencies — `tcell/v2` and `BurntSushi/toml` — and everything else from the standard library, including the tokeniser and the Language Server Protocol client. Both come through turbo-core; this repository adds none of its own. The [design decisions](docs/en/explanation/design-decisions.md) page explains why. |
| 106 | |
| 107 | ## Requirements |
| 108 | |
| 109 | Go 1.26 or later. A terminal with mouse reporting, which is all of them. `gopls` is optional. |
| 110 | |
| 111 | ## Licence |
| 112 | |
| 113 | See [LICENSE](LICENSE). |