Skip to content
HelgeSverrePublic

About

Minimal text editor in Rust using the Elm Architecture

Topics

Resources

Contributing

Stars

9 stars

Watchers

0 watching

Forks

Latest commit

 

History

1,076 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Token - A Multi-Cursor Text Editor

Multi-cursor, code editor inspired by JetBrains IDEs, Vibe-coded in Rust, using Amp Code.
The repository includes a reviewed archive of 171 Amp conversations that informed the project.

Rust Amp License: MIT token-editor.com

Token Screenshot


Installation

Pre-built Binaries

Download the latest release for your platform from token-editor.com or GitHub Releases.

Building from Source

Requires the Rust toolchain.

git clone https://github.com/HelgeSverre/token
cd token
just setup    # Install dependencies
just release  # Build optimized binary
just run      # Run the editor

For development:

just dev      # Run debug build (faster compile)
just watch    # Start bacon watch mode

Windows MSI packaging requires Windows, the Rust MSVC toolchain, PowerShell 7, and WiX Toolset 3.14 (candle.exe/light.exe on PATH, or the installation directory in WIX). Run just bundle-windows; the installer is written to target/x86_64-pc-windows-msvc/release/bundle/msi/Token.msi. The CI-only smoke script installs and uninstalls the package, so run it only on a disposable Windows system.


Quick Start

  1. Open a file: token path/to/file.rs or use Cmd+O
  2. Open a folder: token path/to/project/ or use Cmd+Shift+O
  3. Command palette: Cmd+Shift+A for all available commands
  4. Toggle sidebar: Cmd+1 to show/hide the file tree

Command line

token returns to the shell right away and opens files in the editor that is already running; a folder always gets its own window.

Invocation Effect
token src/main.rs:42:7 Open at line 42, column 7 (--line/--column also work)
token -w notes.md Block until the tab is closed (or the editor exits)
token -w Block until the editor exits
token . Open the folder in its own window, reusing one already showing it
echo text | token - Open stdin in a new tab
token --new-window file.rs Start a separate editor instead of reusing the running one
token --foreground file.rs Run the editor in this process, logs on stderr
token automate instances List running editors; --instance <pid> targets one

Use it as a blocking editor with git config --global core.editor "token -w" or export EDITOR="token -w".

Shell completions

token --completions <shell> prints a completion script for bash, zsh, fish, powershell or nu:

token --completions zsh > "${fpath[1]}/_token"
token --completions bash > /etc/bash_completion.d/token
token --completions fish > ~/.config/fish/completions/token.fish
token --completions powershell >> $PROFILE
token --completions nu | save ~/.config/nushell/completions/token.nu   # then `source` it in config.nu

Keyboard Shortcuts

Common shortcuts (Cmd = Command on macOS, Ctrl on Windows/Linux):

Files & Navigation

Action Shortcut
Save Cmd+S
Open File Cmd+O
Open Folder Cmd+Shift+O
Command Palette Cmd+Shift+A
Go to Line Cmd+L
Find/Replace Cmd+F
Toggle Sidebar Cmd+1

Editing

Action Shortcut
Undo Cmd+Z
Redo Cmd+Shift+Z
Copy/Cut/Paste Cmd+C/X/V
Select All Cmd+A
Duplicate Cmd+D
Delete Line Cmd+Backspace

Multi-Cursor

Action Shortcut
Add cursor Option+Click
Add cursor above Option+Option+Up
Add cursor below Option+Option+Down
Select next match Cmd+J

Note: Option+Option shortcuts are hardcoded and not remappable via keymap.yaml.

Navigation

Action Shortcut
Word left/right Option+←/→
Line start/end Cmd+←/→ or Home/End
Document start/end Ctrl+Home/End
Expand selection Option+↑
Shrink selection Option+↓

For the complete keybinding reference, see docs/KEYBINDINGS.md.


Configuration

Configuration files are stored in ~/.config/token-editor/:

File Purpose
keymap.yaml Custom keybindings
config.yaml Editor and UI preferences, including fonts
themes/<name>.yaml Custom themes

See the documentation for details:

  • Keybindings — Customize keyboard shortcuts
  • Themes — Create and customize themes

Commands

Run just help for the full command list.

Command Description
just build Build debug binary
just release Build optimized release binary
just run Run release build
just dev Run debug build (faster compile)
just test Run all tests
just fmt Format code
just lint Run clippy lints

The installed command is named token; desktop bundles and operating-system UI use the product name Token. On macOS, just app detects the host architecture, builds the native bundle and versioned archive, and opens Token.app.


Built with AI

Token was built primarily through conversations with AI coding assistants, demonstrating effective human-AI collaboration on complex software projects. The methodology and 171 referenced Amp conversations are preserved in this repository so the evidence does not depend on a third-party profile remaining public.


Documentation

Document Description
KEYBINDINGS.md Complete keyboard shortcuts reference
THEMES.md Theme customization guide
BUILDING_WITH_AI.md AI-assisted development framework
EDITOR_UI_REFERENCE.md Technical reference for editor geometry
CHANGELOG.md Version history
CONTRIBUTING.md Contribution guidelines

License

This project is licensed under the MIT License.

The included font, JetBrains Mono, is licensed under the OFL-1.1. The UI font, Inter 4.1, is bundled unmodified under its OFL-1.1 license.

Markdown preview bundles Mermaid and Highlight.js for offline diagrams and code highlighting, with their MIT and BSD-3-Clause licenses.

About

Minimal text editor in Rust using the Elm Architecture

Topics

Resources

Contributing

Stars

9 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages