# Tutorial: your first file in Turbo Go By the end of this tutorial, you will have built the editor, written a small Go 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 Go is needed. You need Go 1.26 or later and a terminal — that is all. ## Prerequisites Check that Go is there: ```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/ ## Step 1 — Build the editor From the project directory, type: ```bash make build ``` You should see: ``` go build -o bin/turbo-go . ``` and then nothing more. Silence is success: Go says nothing when a build works. We now have an executable at `bin/turbo-go`. Remember where it is, so we can start it from anywhere: ```bash export TURBO="$PWD/bin/turbo-go" ``` ## Step 2 — Create a place to work Turbo Go is at its best inside a Go module, so let us make one: ```bash mkdir -p /tmp/hello && cd /tmp/hello go mod init hello ``` You should see: ``` go: creating new go.mod: module hello ``` We have just created an empty Go module. ## Step 3 — Open the editor Start Turbo Go on a file that does not exist yet: ```bash $TURBO main.go ``` The screen fills with a blue desktop. You should see: - a **menu bar** across the top: `File Edit Search Run Code Options Window Snippets Go Help` - a **window** framed in a double line, titled `main.go` - 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 — Type a Go program Type these five lines, pressing Enter at the end of each: ```go package main import "fmt" func main() { ``` Watch the colours as you type. `package`, `import` and `func` turn **white and bold** the moment the word ends: they are keywords. `"fmt"` turns **green**: it is a string. `main` turns **yellow and bold** as soon as you type the `(` after it, because that makes it a function. Now press **Tab**. The cursor jumps to column 9 — the status bar on the right changes to `5:2`, because a tab is one character wide in the file even though it fills eight columns on screen. Type the body of the function: ```go fmt.Println("Hello from Turbo Go!") ``` > When you type the `.` after `fmt`, the status bar briefly shows a message about the language server. That is expected: completion needs `gopls`, which we have not set up. The [completion guide](../how-to/enable-completion.md) covers it later; ignore it for now. Press **Enter**. Look at the new line: the cursor is *already* at column 9. Turbo Go copied the indentation of the line above, which is what you want nine times out of ten. This time we do not want it, so press **Shift-Tab** to take that indent back off, then type the closing brace: ```go } ``` The window title now reads `main.go *`. The star means there are unsaved changes. We have just written a complete Go 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 main.go ``` 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 main.go ``` You should see: ```go package main import "fmt" func main() { fmt.Println("Hello from Turbo Go!") } ``` ## Step 7 — Run it ```bash go run main.go ``` You should see: ``` Hello from Turbo Go! ``` That is a working Go program, written entirely inside the editor. ## Step 8 — Change the theme Open the file again: ```bash $TURBO main.go ``` 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 Go 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/)