turbo-editors/turbo-gopublic Fork 0
main
Commits
Clone
git clone https://git.rickub.com/turbo-editors/turbo-go.git
git clone ssh://git@rickub.com/turbo-editors/turbo-go.git

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

getting-started.md · 202 lines · 4.8 KBmarkdown Blame HistoryRaw
📦 Turbo Go 3d7798b k33g 11h ago1# Tutorial: your first file in Turbo Go
2
3By 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.
4
5No prior knowledge of Turbo Go is needed. You need Go 1.26 or later and a terminal — that is all.
6
7## Prerequisites
8
9Check that Go is there:
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
23## Step 1 — Build the editor
24
25From the project directory, type:
26
27```bash
28make build
29```
30
31You should see:
32
33```
34go build -o bin/turbo-go .
35```
36
37and then nothing more. Silence is success: Go says nothing when a build works.
38
39We now have an executable at `bin/turbo-go`. Remember where it is, so we can start it from anywhere:
40
41```bash
42export TURBO="$PWD/bin/turbo-go"
43```
44
45## Step 2 — Create a place to work
46
47Turbo Go is at its best inside a Go module, so let us make one:
48
49```bash
50mkdir -p /tmp/hello && cd /tmp/hello
51go mod init hello
52```
53
54You should see:
55
56```
57go: creating new go.mod: module hello
58```
59
60We have just created an empty Go module.
61
62## Step 3 — Open the editor
63
64Start Turbo Go on a file that does not exist yet:
65
66```bash
67$TURBO main.go
68```
69
70The screen fills with a blue desktop. You should see:
71
72- a **menu bar** across the top: `File Edit Search Run Code Options Window Snippets Go Help`
73- a **window** framed in a double line, titled `main.go`
74- a **status bar** along the bottom: `F1 Describe F2 Save F3 Open …`
75
76The cursor is blinking at line 1, column 1 — the status bar says `1:1` on the right.
77
78We are inside the editor.
79
80## Step 4 — Type a Go program
81
82Type these five lines, pressing Enter at the end of each:
83
84```go
85package main
86
87import "fmt"
88
89func main() {
90```
91
92Watch 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.
93
94Now 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.
95
96Type the body of the function:
97
98```go
99fmt.Println("Hello from Turbo Go!")
100```
101
102> 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.
103
104Press **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.
105
106This time we do not want it, so press **Shift-Tab** to take that indent back off, then type the closing brace:
107
108```go
109}
110```
111
112The window title now reads `main.go *`. The star means there are unsaved changes.
113
114We have just written a complete Go program, with the editor colouring it as we went.
115
116## Step 5 — Save it
117
118Press **F2**.
119
120The star disappears from the title, and the status bar says:
121
122```
123Saved main.go
124```
125
126We have just written the file to disk.
127
128## Step 6 — Look at the file from outside
129
130Leave the editor by pressing **Alt-X**. The terminal comes back as it was.
131
132Check what we wrote:
133
134```bash
135cat main.go
136```
137
138You should see:
139
140```go
141package main
142
143import "fmt"
144
145func main() {
146 fmt.Println("Hello from Turbo Go!")
147}
148```
149
150## Step 7 — Run it
151
152```bash
153go run main.go
154```
155
156You should see:
157
158```
159Hello from Turbo Go!
160```
161
162That is a working Go program, written entirely inside the editor.
163
164## Step 8 — Change the theme
165
166Open the file again:
167
168```bash
169$TURBO main.go
170```
171
172Press **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**.
173
174A list of eleven appears, in alphabetical order, with the theme you are using already highlighted:
175
176```
177borland-light
178cappuccino
179catppuccin-frappe
180catppuccin-latte
181cobalt
182darcula
183intellij-light
184monochrome-dark
185monochrome-light
186turbo-classic
187turbo-dark
188```
189
190`turbo-classic` is the highlighted row, because that is the theme you are in. Press **↓** once to move to `turbo-dark`, then press **Enter**.
191
192The whole editor repaints in dark grey, and the status bar says `Theme: Turbo Dark`.
193
194Press **Alt-X** to leave.
195
196## What now?
197
198You have built the editor, written a Go program in it, saved it, run it, and changed how it looks.
199
200- To do specific things — enable completion, write a theme of your own, search a file → see the [how-to guides](../how-to/)
201- To look up a key or a menu item → see the [reference](../reference/)
202- To understand how the colouring and the completion actually work → see the [explanation](../explanation/)