turbo-rust
A Turbo C-style editor for Rust, written in Go.
Built on turbo-core, the library every Turbo editor shares. What is in this repository is the command, the profile that says this editor is for Rust, and the Rust scanner — about seven hundred lines. Everything else lives in the library.
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 Rust editor needs today: syntax colouring that knows nested block comments and raw strings, loadable colour themes, completion from rust-analyzer, shell windows, per-project settings, a project tree, snippets, and the cargo toolchain a menu away.
File Edit Search Run Options Window Snippets Rust Help
╔═[x]═════════════════════════════ adder.rs ════════════════════════════════1═[■]╗
║ 1 //! A demo crate. ▲║
║ 2 use std::collections::HashMap; ▓║
║ 3 ░║
║ 4 /// Adds two numbers. ░║
║ 5 #[derive(Debug, Clone)] ░║
║ 6 pub struct Adder<'a> { ░║
║ 7 name: &'a str, ░║
║ 8 seen: HashMap<String, u64>, ░║
║ 9 } ▼║
║◄▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░►║
╚════════════════════════════════════════════════════════════════════════════════╝
F1 Describe F2 Save F3 Open F6 Window F7 Next F10 Menu 1:1 LSP: ready
Getting started
make install
That builds the editor, puts it where your shell looks for commands, and reports what it found — the Go version it built with, where the binary went, whether that directory is on your PATH, and whether rust-analyzer is installed. Then, from any Rust crate:
turbo-rust src/main.rs
To build without installing, make build leaves the binary in bin/turbo-rust. From the module proxy instead of a checkout: go install rickub.com/turbo-editors/turbo-rust@latest.
For completion, install the Rust language server as well — the editor works without it, and says so on the status bar:
rustup component add rust-analyzer
The tutorial walks through a first session in about ten minutes.
Features
- Every build knows what it is —
turbo-rust -versionand Help ▸ About name the version, the commit and the build date, stamped in by the linker fromgit describerather than read from a constant somebody forgot to bump - Turbo Vision interface — menu bar with
Alt-letter hot keys, overlapping movable and resizable windows, modal dialogs, mouse support throughout - Syntax colouring for nine languages — Rust by a hand-written scanner that carries nested block comments, raw strings and multi-line strings exactly, and tells a lifetime from a character literal; plus TOML, Markdown, JavaScript, HTML and shell scripts from turbo-core
- 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
- Per-project settings in
.turbo-rust/settings.toml— pin a theme, turn on automatic saving — created from a menu item and never by itself - Completion, hover and go-to-definition from
rust-analyzer, entirely optional - Terminal windows —
F8opens a real shell in a window, with its own VT/ANSI emulator, scrollback and job control (Linux, macOS and Windows) - Project tree —
F9shows the project's files in a window; walk it with the arrows and press Enter to open one - Snippets — a
Snippetsmenu built from.turbo-rust/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 - The cargo toolchain a menu away —
Alt-Trunscargo fmt,cargo clippy,cargo build,cargo testandcargo runfrom.turbo-rust/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 amenuof its own gets that menu on the bar - Editing with word movement, block indent, a shared clipboard, and undo that merges a run of typing into one step
- Faithful files — line endings and the trailing newline are preserved, and saving is atomic
- Automatic saving, off by default, writing a short while after you stop typing
Commands
| Command | What it does |
|---|---|
make install |
Build and install onto your PATH |
make build |
Compile into bin/turbo-rust |
make test |
Run the whole test suite |
make check |
fmt, vet, then the tests — what a commit should pass |
make run FILE=x.go |
Build and start the editor on a file |
make help |
List every target |
turbo-rust [-theme name] [-no-lsp] [file...]
turbo-rust -list-themes
Documentation
Full documentation in English and French, organised by the Diátaxis method:
| Tutorial | Your first file in Turbo Rust |
| How-to | install · run the tests · enable completion · write a theme · move around a file · use a terminal · configure a project · browse a project · use snippets · run cargo commands · make a release |
| Reference | command line · keyboard · menus · theme format · terminal windows · project settings · project tree · languages · snippets · Rust tools · the version number |
| Explanation | architecture · design decisions · colouring and completion · terminal windows · project settings · project tree · snippets · Rust tools |
The library's packages each carry their own README.md beside the code, in turbo-core.
Where the code is
main.go |
flags, the terminal, the wiring |
internal/rustlang |
the profile, the Rust scanner, the three starter files |
| everything else | turbo-core |
The dependency graph is drawn in docs/diagrams/packages.drawio, checked against go list.
Design in one line
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 page explains why.
Requirements
Go 1.26 or later to build it — the editor is written in Go even though it is an editor for Rust. A terminal with mouse reporting, which is all of them. rust-analyzer is optional.
Licence
See LICENSE.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|