Rune Documentation
Complete guide to rune v1.4.1, a modern CLI text editor inspired by nano but with many more features.
Installation
Quick Install
The fastest way to install rune. Auto-detects your platform and installs the latest release binary.
Homebrew (macOS and Linux)
Cargo (from source)
Arch Linux (AUR)
Build from source
Supported platforms
- macOS -- Intel (x86_64) and Apple Silicon (aarch64)
- Linux -- x86_64, ARM64 (aarch64), ARMv7
- FreeBSD -- x86_64
- NetBSD -- x86_64
First Steps
Open a file by passing it as an argument:
Create a new file:
Open multiple files in tabs:
Open a directory (all files loaded as tabs):
Just launch the editor with an empty buffer:
Press Ctrl+H at any time to open the built-in help reference as a tab inside the editor.
Opening Files
Rune detects the file type from its extension and automatically enables syntax highlighting. If the file does not exist, rune creates a new buffer and will create the file (including any parent directories) when you save.
When you open multiple files, each gets its own tab. The tab bar appears at the top of the screen showing all open buffers. Modified files show an indicator in their tab title.
When two files share the same name (e.g., src/config.rs and tests/config.rs), rune shows relative paths in the tab titles to disambiguate them.
Basic Editing
Rune is a modeless editor -- just start typing. There is no insert mode to enter. What you see is what you get.
- Type to insert text at the cursor position
- Enter inserts a new line with auto-indent (matches the indentation of the current line)
- Backspace deletes the character before the cursor
- Delete deletes the character after the cursor (forward delete)
- Ctrl+S saves the file (prompts for a filename if new)
- Ctrl+W saves with a new filename (Save As)
- Ctrl+Q or Ctrl+X quits (prompts to save if there are unsaved changes)
Selection and Clipboard
Mark mode
Press Alt+A to start a selection at the current cursor position. Move the cursor to extend the selection -- the selected region is visually highlighted. Press Alt+A again or Esc to cancel the selection.
Cut, copy, and paste
| Key | Action |
|---|---|
| Ctrl+K | Cut the current line (or cut selection if mark mode is active) |
| Alt+6 | Copy the current line (or copy selection if mark mode is active) |
| Ctrl+U | Paste the most recently cut/copied text |
Without a selection, Ctrl+K cuts the entire current line and Alt+6 copies it. With a selection active, they operate on the selected text only.
Indentation
Rune supports block indent and unindent for selected text:
| Key | Action |
|---|---|
| Alt+} | Indent the selected block (or current line) by one tab stop |
| Alt+{ | Unindent the selected block (or current line) by one tab stop |
The tab width is configurable (2, 4, or 8 spaces) via Ctrl+O options menu or the config file.
When you press Enter, the new line is automatically indented to match the indentation level of the current line.
Comment Toggle
Press Alt+; to toggle comments on the current line or selected lines. Rune is language-aware and uses the correct comment style:
//for Rust, C, C++, Go, Java, JavaScript, TypeScript, Swift, Kotlin, Dart, Zig#for Python, Ruby, Shell, TOML, YAML, PHP, Elixir, Dockerfile--for SQL, Lua, Haskell
If the line is already commented, Alt+; removes the comment prefix. If multiple lines are selected, all lines are toggled together.
Word Completion
Press Alt+\ to trigger word completion from the current buffer. Rune scans the buffer for words that match the prefix at the cursor position and inserts the first match. Press Alt+\ again to cycle through additional matches.
Undo and Redo
| Key | Action |
|---|---|
| Ctrl+Z | Undo the last change |
| Ctrl+Y | Redo the last undone change |
Rune maintains a history of up to 100 actions for undo/redo.
Cursor Movement
| Key | Action |
|---|---|
| Arrow keys | Move cursor one character/line |
| Ctrl+Left/Right | Jump by word |
| Home | Go to start of line |
| End | Go to end of line |
| Ctrl+Home | Go to start of file |
| Ctrl+End | Go to end of file |
| Page Up | Scroll up one page |
| Page Down | Scroll down one page |
| Ctrl+V | Page down (nano-compatible) |
| Ctrl+Y | Page up (nano-compatible) |
| Ctrl+C | Show cursor position info (line, column, character count) |
Go to Line
Press Ctrl+G to jump to a specific line number. A prompt appears at the bottom of the screen -- type the line number and press Enter. Press Esc to cancel.
Bracket Matching
Press Alt+] to jump to the matching bracket. Supports (), [], {}. The cursor jumps from the opening bracket to the closing bracket and vice versa.
Find
Press Ctrl+F to enter search mode. Type your search query and all matches are highlighted in real-time as you type.
- Up/Down arrows navigate between matches (shows "3/7 matches" counter)
- Enter exits search mode and stays at the current match
- Esc cancels the search and returns to the original cursor position
- Search wraps around document boundaries
Replace
From search mode, press Ctrl+R to switch to replace mode. You can also enter replace mode directly with Ctrl+\ (nano-compatible).
For each match, you are prompted with:
- Y -- replace this match and move to next
- N -- skip this match and move to next
- A -- replace all remaining matches
Search Options
While in search mode, you can toggle these options:
| Key | Option |
|---|---|
| Ctrl+C | Toggle case sensitivity |
| Ctrl+R | Toggle regex mode / enter replace |
Rune stores up to 50 search history entries. Use Up/Down arrows in the search prompt to recall previous searches.
Working with Tabs
Rune supports multiple buffers via a tab bar at the top of the screen.
| Key | Action |
|---|---|
| Ctrl+T | Open a new empty tab |
| Alt+Left | Switch to the previous tab |
| Alt+Right | Switch to the next tab |
| Alt+W | Close the current tab (prompts to save if modified) |
| Ctrl+P | Open the fuzzy finder to jump between tabs |
Fuzzy Finder
Press Ctrl+P to open the fuzzy finder. It shows a list of all open tabs. Start typing to filter -- the matching is fuzzy, so you can type any substring of the filename. Press Enter to jump to the selected tab, or Esc to cancel.
Opening Directories
You can open all files in a directory as tabs:
When opening recursively with -r, rune respects your .gitignore rules and skips ignored files.
Hex View
Press Ctrl+B to toggle the hex view. This shows the raw bytes of the buffer in a traditional hex dump format with ASCII representation alongside. The cursor position is synced between the text view and hex view, so you can navigate in hex view and return to the same position in text view.
This is useful for inspecting binary files, checking encoding, or debugging invisible characters.
Whitespace Display
Press Alt+P to toggle whitespace visibility. When enabled, spaces, tabs, and line endings are rendered with visible markers so you can see exactly what whitespace characters are in the file.
Line Numbers
Toggle line numbers via the options menu (Ctrl+O, then L) or set show_line_numbers in the config file. Line numbers appear in the left gutter.
Word Wrap
Toggle word wrap via the options menu (Ctrl+O, then W) or set word_wrap in the config file. When disabled, long lines extend beyond the screen edge and the view scrolls horizontally as you navigate.
Execute Command
Press Ctrl+E to run a shell command from within the editor. A prompt appears at the bottom -- type the command and press Enter. You will be asked to confirm before execution.
If you have a selection active, the selected text is piped as stdin to the command, and the output replaces the selection. This lets you pipe text through external tools like sort, fmt, jq, etc.
Commands have a 10-second timeout and a 1MB output limit. If a command exceeds either limit, it is terminated.
Syntax Highlighting
Rune automatically detects the file type from the extension and applies syntax highlighting. Highlighting is lazy (only visible lines are processed) and cached (scrolling back to previously viewed lines is instant).
Highlighted elements include:
- Keywords (language-specific reserved words)
- Types (built-in and common type names)
- Strings (with proper escape sequence handling)
- Numbers (integers, floats, hex literals)
- Comments (line and block comments)
See the supported languages section for the full list.
Mouse Support
When enabled (the default), mouse support provides:
- Click to position the cursor
- Drag to select text
- Scroll wheel to scroll the document
You can disable mouse support via Ctrl+O then M, or set mouse_enabled = false in the config file. Disabling mouse support allows your terminal's native text selection (useful for copying text to the system clipboard).
All Keybindings
File Operations
| Key | Action |
|---|---|
| Ctrl+S | Save file (prompts for filename if new) |
| Ctrl+W | Save As (save with new filename) |
| Ctrl+Q / Ctrl+X | Quit editor (prompts to save if modified) |
| Ctrl+H | Open help as a tab |
Editing
| Key | Action |
|---|---|
| Ctrl+Z | Undo |
| Ctrl+Y | Redo |
| Ctrl+K | Cut line (or selection) |
| Alt+6 | Copy line (or selection) |
| Ctrl+U | Paste |
| Alt+A | Toggle mark/selection mode |
| Delete | Delete character forward |
| Alt+} | Indent selected block |
| Alt+{ | Unindent selected block |
| Alt+; | Toggle comment (language-aware: //, #, --) |
| Alt+\ | Word completion from buffer |
| Alt+V | Verbatim input (insert literal control character) |
| Ctrl+E | Execute shell command |
Navigation
| Key | Action |
|---|---|
| Arrow keys | Move cursor |
| Ctrl+Left/Right | Jump by word |
| Home / End | Start / end of line |
| Ctrl+Home / Ctrl+End | Start / end of file |
| Ctrl+G | Go to line number |
| Alt+] | Jump to matching bracket |
| Ctrl+C | Show cursor position info |
| Page Up / Page Down | Scroll by page |
| Ctrl+V / Ctrl+Y | Page down / Page up (nano-style) |
| Mouse click | Position cursor |
| Mouse scroll | Scroll document |
Search and Replace
| Key | Action |
|---|---|
| Ctrl+F | Find (incremental search with live highlighting) |
| Ctrl+R | Replace (within find mode) |
| Ctrl+\ | Replace (nano-compatible direct entry) |
| Up/Down in search | Navigate between matches |
| Esc | Cancel search, return to original position |
Tabs
| Key | Action |
|---|---|
| Ctrl+T | Open new tab |
| Alt+Left / Alt+Right | Switch to previous / next tab |
| Alt+W | Close current tab |
| Ctrl+P | Fuzzy finder (jump between tabs) |
View
| Key | Action |
|---|---|
| Ctrl+B | Toggle hex view |
| Alt+P | Toggle whitespace display |
| Ctrl+O | Options menu (line numbers, wrap, tab width, mouse) |
Configuration
Rune stores its configuration at ~/.config/rune/config.toml. You can also change settings live via the options menu (Ctrl+O) -- changes are saved automatically.
Configuration file format
All configuration options
| Key | Type | Default | Description |
|---|---|---|---|
| mouse_enabled | bool | true | Enable mouse support (click, drag, scroll). Disable for native terminal selection. |
| show_line_numbers | bool | false | Show line numbers in the left gutter. |
| tab_width | int | 4 | Number of spaces per tab stop. Valid values: 2, 4, 8. |
| word_wrap | bool | false | Wrap long lines at the screen edge. When off, lines scroll horizontally. |
Options menu
Press Ctrl+O to open the live options menu. Press the key shown next to each option to toggle it:
| Key | Option |
|---|---|
| M | Toggle mouse mode |
| L | Toggle line numbers |
| W | Toggle word wrap |
| T | Cycle tab width (2 -> 4 -> 8 -> 2) |
Changes take effect immediately and are saved to the config file.
Supported Languages
Rune provides syntax highlighting for 26 languages. Detection is automatic based on file extension.
| Language | Extensions | Comment style |
|---|---|---|
| Rust | .rs | // |
| Python | .py | # |
| JavaScript | .js, .mjs, .cjs | // |
| TypeScript | .ts, .tsx | // |
| Go | .go | // |
| C | .c, .h | // |
| C++ | .cpp, .cc, .hpp | // |
| Java | .java | // |
| Shell / Bash | .sh, .bash, .zsh | # |
| HTML | .html, .htm | <!-- --> |
| CSS | .css | /* */ |
| JSON | .json | -- |
| TOML | .toml | # |
| YAML | .yaml, .yml | # |
| Markdown | .md | -- |
| SQL | .sql | -- |
| Ruby | .rb | # |
| PHP | .php | // or # |
| Lua | .lua | -- |
| Swift | .swift | // |
| Kotlin | .kt, .kts | // |
| Dart | .dart | // |
| Zig | .zig | // |
| Haskell | .hs | -- |
| Elixir | .ex, .exs | # |
| Dockerfile | Dockerfile | # |
Syntax highlighting is lazy (only visible lines are processed), incremental (only changed lines are re-highlighted), and cached (scrolling back to seen lines is instant). There is zero startup cost -- highlighting loads on demand.