turbo-editors/turbo-rustpublic Fork 0
v1.0.1
Commits
Clone
git clone https://git.rickub.com/turbo-editors/turbo-rust.git
git clone ssh://git@rickub.com/turbo-editors/turbo-rust.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

getting-started.md · 205 lines · 5.4 KBmarkdown Blame HistoryRaw
📦 Turbo Rust 713ea5c k33g 11h ago1# Tutorial: your first file in Turbo Rust
2
3By the end of this tutorial, you will have built the editor, written a small Rust program inside it, watched the keywords turn colour as you typed, saved the file, and run it. It takes about ten minutes.
4
5No prior knowledge of Turbo Rust is needed. You need Go 1.26 or later to build the editor, and Rust to run what you write in it.
6
7## Prerequisites
8
9Check that Go is there — the editor is written in Go, even though it is an editor for Rust:
10
11```bash
12go version
13```
14
15You should see something like:
16
17```
18go version go1.26.5 linux/arm64
19```
20
21If that command fails, install Go first: https://go.dev/dl/
22
23Check that Rust is there too:
24
25```bash
26cargo --version
27```
28
29You should see something like:
30
31```
32cargo 1.97.1 (8bab26f4f 2026-07-14)
33```
34
35If that command fails, install Rust from https://rustup.rs
36
37## Step 1 — Build the editor
38
39From the project directory, type:
40
41```bash
42make build
43```
44
45You should see a `go build` line, and then nothing more. Silence is success: Go says nothing when a build works.
46
47We now have an executable at `bin/turbo-rust`. Remember where it is, so we can start it from anywhere:
48
49```bash
50export TURBO="$PWD/bin/turbo-rust"
51```
52
53## Step 2 — Create a place to work
54
55Turbo Rust is at its best inside a crate, so let us make one:
56
57```bash
58cd /tmp && cargo new hello && cd hello
59```
60
61You should see:
62
63```
64 Creating binary (application) `hello` package
65```
66
67`cargo new` writes a `Cargo.toml` and a `src/main.rs` with a hello-world in it. We are going to replace that file's contents with our own.
68
69## Step 3 — Open the editor
70
71Start Turbo Rust on the file cargo made:
72
73```bash
74$TURBO src/main.rs
75```
76
77The screen fills with a blue desktop. You should see:
78
79- a **menu bar** across the top: `File Edit Search Run Code Options Window Snippets Rust Help`
80- a **window** framed in a double line, titled `main.rs`
81- a **status bar** along the bottom: `F1 Describe F2 Save F3 Open …`
82
83The cursor is blinking at line 1, column 1 — the status bar says `1:1` on the right.
84
85We are inside the editor.
86
87## Step 4 — Clear the file and type a Rust program
88
89Press **Ctrl-A** to select everything cargo wrote, then **Delete** to remove it. The window is now empty and its title reads `main.rs *` — the star means there are unsaved changes.
90
91Type these two lines, pressing Enter at the end of each:
92
93```rust
94fn main() {
95 let name = "Turbo Rust";
96```
97
98Watch the colours as you type. `fn` and `let` turn **white and bold** the moment the word ends: they are keywords. `main` turns **yellow and bold** as soon as you type the `(` after it, because that makes it a function. `"Turbo Rust"` turns **green**: it is a string.
99
100(Those are Turbo Classic's colours, the ones the editor starts in. Step 8 changes them.)
101
102Press **Enter**. Look at the new line: the cursor is *already* indented to match the line above. Turbo Rust copied the indentation, which is what you want nine times out of ten.
103
104Type the next line:
105
106```rust
107println!("Hello from {name}!");
108```
109
110`println!` turns **aqua and bold**, with the `!` part of it: a macro is one name, and colouring the `!` separately would make it read as a negation.
111
112> When you type the `.` after a name, the status bar briefly shows a message about the language server. That is expected: completion needs `rust-analyzer`, which we have not set up. The [completion guide](../how-to/enable-completion.md) covers it later; ignore it for now.
113
114Press **Enter**, then **Shift-Tab** to take the indent back off, then type the closing brace:
115
116```rust
117}
118```
119
120We have just written a complete Rust program, with the editor colouring it as we went.
121
122## Step 5 — Save it
123
124Press **F2**.
125
126The star disappears from the title, and the status bar says:
127
128```
129Saved src/main.rs
130```
131
132We have just written the file to disk.
133
134## Step 6 — Look at the file from outside
135
136Leave the editor by pressing **Alt-X**. The terminal comes back as it was.
137
138Check what we wrote:
139
140```bash
141cat src/main.rs
142```
143
144You should see:
145
146```rust
147fn main() {
148 let name = "Turbo Rust";
149 println!("Hello from {name}!");
150}
151```
152
153## Step 7 — Run it
154
155```bash
156cargo run
157```
158
159You should see, after a line or two from cargo:
160
161```
162Hello from Turbo Rust!
163```
164
165That is a working Rust program, written entirely inside the editor.
166
167## Step 8 — Change the theme
168
169Open the file again:
170
171```bash
172$TURBO src/main.rs
173```
174
175Press **F10**. The `File` menu drops open. Press **→** five times: the menu walks along the bar to `Options`, whose first item, `Theme…`, is highlighted. Press **Enter**.
176
177A list of eleven appears, in alphabetical order, with the theme you are using already highlighted:
178
179```
180borland-light
181cappuccino
182catppuccin-frappe
183catppuccin-latte
184cobalt
185darcula
186intellij-light
187monochrome-dark
188monochrome-light
189turbo-classic
190turbo-dark
191```
192
193`turbo-classic` is the highlighted row, because that is the theme you are in. Press **↓** once to move to `turbo-dark`, then press **Enter**.
194
195The whole editor repaints in dark grey, and the status bar says `Theme: Turbo Dark`.
196
197Press **Alt-X** to leave.
198
199## What now?
200
201You have built the editor, written a Rust program in it, saved it, run it, and changed how it looks.
202
203- To do specific things — enable completion, write a theme of your own, search a file → see the [how-to guides](../how-to/)
204- To look up a key or a menu item → see the [reference](../reference/)
205- To understand how the colouring and the completion actually work → see the [explanation](../explanation/)