# Tutorial: your first file in Turbo Rust By 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. No 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. ## Prerequisites Check that Go is there — the editor is written in Go, even though it is an editor for Rust: ```bash go version ``` You should see something like: ``` go version go1.26.5 linux/arm64 ``` If that command fails, install Go first: https://go.dev/dl/ Check that Rust is there too: ```bash cargo --version ``` You should see something like: ``` cargo 1.97.1 (8bab26f4f 2026-07-14) ``` If that command fails, install Rust from https://rustup.rs ## Step 1 — Build the editor From the project directory, type: ```bash make build ``` You should see a `go build` line, and then nothing more. Silence is success: Go says nothing when a build works. We now have an executable at `bin/turbo-rust`. Remember where it is, so we can start it from anywhere: ```bash export TURBO="$PWD/bin/turbo-rust" ``` ## Step 2 — Create a place to work Turbo Rust is at its best inside a crate, so let us make one: ```bash cd /tmp && cargo new hello && cd hello ``` You should see: ``` Creating binary (application) `hello` package ``` `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. ## Step 3 — Open the editor Start Turbo Rust on the file cargo made: ```bash $TURBO src/main.rs ``` The screen fills with a blue desktop. You should see: - a **menu bar** across the top: `File Edit Search Run Code Options Window Snippets Rust Help` - a **window** framed in a double line, titled `main.rs` - a **status bar** along the bottom: `F1 Describe F2 Save F3 Open …` The cursor is blinking at line 1, column 1 — the status bar says `1:1` on the right. We are inside the editor. ## Step 4 — Clear the file and type a Rust program Press **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. Type these two lines, pressing Enter at the end of each: ```rust fn main() { let name = "Turbo Rust"; ``` Watch 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. (Those are Turbo Classic's colours, the ones the editor starts in. Step 8 changes them.) Press **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. Type the next line: ```rust println!("Hello from {name}!"); ``` `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. > 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. Press **Enter**, then **Shift-Tab** to take the indent back off, then type the closing brace: ```rust } ``` We have just written a complete Rust program, with the editor colouring it as we went. ## Step 5 — Save it Press **F2**. The star disappears from the title, and the status bar says: ``` Saved src/main.rs ``` We have just written the file to disk. ## Step 6 — Look at the file from outside Leave the editor by pressing **Alt-X**. The terminal comes back as it was. Check what we wrote: ```bash cat src/main.rs ``` You should see: ```rust fn main() { let name = "Turbo Rust"; println!("Hello from {name}!"); } ``` ## Step 7 — Run it ```bash cargo run ``` You should see, after a line or two from cargo: ``` Hello from Turbo Rust! ``` That is a working Rust program, written entirely inside the editor. ## Step 8 — Change the theme Open the file again: ```bash $TURBO src/main.rs ``` Press **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**. A list of eleven appears, in alphabetical order, with the theme you are using already highlighted: ``` borland-light cappuccino catppuccin-frappe catppuccin-latte cobalt darcula intellij-light monochrome-dark monochrome-light turbo-classic turbo-dark ``` `turbo-classic` is the highlighted row, because that is the theme you are in. Press **↓** once to move to `turbo-dark`, then press **Enter**. The whole editor repaints in dark grey, and the status bar says `Theme: Turbo Dark`. Press **Alt-X** to leave. ## What now? You have built the editor, written a Rust program in it, saved it, run it, and changed how it looks. - To do specific things — enable completion, write a theme of your own, search a file → see the [how-to guides](../how-to/) - To look up a key or a menu item → see the [reference](../reference/) - To understand how the colouring and the completion actually work → see the [explanation](../explanation/)