# turbo-js A Turbo C-style editor for JavaScript on Node.js, written in Go. Built on **[turbo-core](https://rickub.com/turbo-editors/turbo-core)**, the library every Turbo editor shares. What is in this repository is the command, the profile that says this editor is for JavaScript, a JavaScript scanner and a JSON one — about twelve 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 Node editor needs today: syntax colouring that knows regular expressions, template literals, private fields and Node's globals, loadable colour themes, completion and diagnostics from `typescript-language-server`, shell windows, per-project settings, a project tree, snippets, windows onto coding agents, and the Node toolchain a menu away. ``` File Edit Search Run Code Options Window Snippets Agent JavaScript Help ╔═[x]═══════════════════════════════════════ main.js ═══════════════════════════1═[■]╗ ║ 1 #!/usr/bin/env node ▲║ ║ 2 // Greets whoever is named on the command line, or JavaScript. ▓║ ║ 3 import { argv } from "node:process"; ░║ ║ 4 import { Greeter } from "./greeter.js"; ░║ ║ 5 ░║ ║ 6 const who = argv[2] ?? "JavaScript"; ░║ ║ 7 new Greeter(who).greet(3); ▼║ ║◄▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░►║ ╚═════════════════════════════════════════════════════════════════════════════════╝ F1 Describe F2 Save F3 Open F6 Window F7 Next F10 Menu Alt-X Exit 1:1 LSP: ready ``` ## Getting started ```bash 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 `typescript-language-server` is installed. Then, from any Node project: ```bash turbo-js main.js ``` To build without installing, `make build` leaves the binary in `bin/turbo-js`. From the module proxy instead of a checkout: `go install rickub.com/turbo-editors/turbo-js@latest`. For completion, install the language server as well — the editor works without it, and says so on the status bar: ```bash npm install -g typescript-language-server typescript@6 ``` The `@6` is not optional: TypeScript 7 ships no `tsserver.js`, and the server refuses to start beside it. `make install` with `--with-server` — `scripts/install.sh --with-server` — runs that line for you. The [tutorial](docs/en/tutorials/getting-started.md) walks through a first session in about ten minutes, and [`demos/greeter`](demos/) is a small project to open once you have the editor. ## Features - **Every build knows what it is** — `turbo-js -version` and **Help ▸ About** name the version, the commit and the build date, stamped in by the linker from `git describe` rather 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** — JavaScript by a hand-written scanner that knows regular expressions, template literals across lines, the hashbang line, private `#fields`, decorators and Node's globals; JSON with keys told from values; plus TOML, YAML, Markdown, HTML, XML, Dockerfiles 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-js/settings.toml` — pin a theme, turn on automatic saving — created from a menu item and never by itself, and re-read every time you save it - **Completion, hover, definitions, references, implementations, symbols and diagnostics** from `typescript-language-server`, all nine questions answered for plain JavaScript, entirely optional - **Terminal windows** — `F8` opens a real shell in a window, with its own VT/ANSI emulator, scrollback and job control (Linux, macOS and Windows) - **Project tree** — `F9` shows the project's files in a window; walk it with the arrows and press Enter to open one - **Snippets** — a `Snippets` menu built from `.turbo-js/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 Node toolchain a menu away** — `Alt-J` runs `npm install`, `npx prettier --write .`, `npx eslint .`, `node --test`, `node