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.

$ curl -fsSL https://rune.byexec.com/install.sh | bash

Homebrew (macOS and Linux)

$ brew install exec/tap/rune

Cargo (from source)

$ cargo install --git https://github.com/exec/rune

Arch Linux (AUR)

$ yay -S rune-editor # or $ paru -S rune-editor

Build from source

$ git clone https://github.com/exec/rune $ cd rune $ cargo build --release $ ./target/release/rune

Supported platforms

First Steps

Open a file by passing it as an argument:

$ rune myfile.rs

Create a new file:

$ rune newfile.py

Open multiple files in tabs:

$ rune file1.rs file2.rs file3.rs

Open a directory (all files loaded as tabs):

$ rune . # or recursively (respects .gitignore) $ rune -r .

Just launch the editor with an empty buffer:

$ rune
Tip

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.

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

KeyAction
Ctrl+KCut the current line (or cut selection if mark mode is active)
Alt+6Copy the current line (or copy selection if mark mode is active)
Ctrl+UPaste the most recently cut/copied text
Note

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:

KeyAction
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:

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

KeyAction
Ctrl+ZUndo the last change
Ctrl+YRedo the last undone change

Rune maintains a history of up to 100 actions for undo/redo.

Cursor Movement

KeyAction
Arrow keysMove cursor one character/line
Ctrl+Left/RightJump by word
HomeGo to start of line
EndGo to end of line
Ctrl+HomeGo to start of file
Ctrl+EndGo to end of file
Page UpScroll up one page
Page DownScroll down one page
Ctrl+VPage down (nano-compatible)
Ctrl+YPage up (nano-compatible)
Ctrl+CShow 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.

Press Ctrl+F to enter search mode. Type your search query and all matches are highlighted in real-time as you type.

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:

Search Options

While in search mode, you can toggle these options:

KeyOption
Ctrl+CToggle case sensitivity
Ctrl+RToggle 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.

KeyAction
Ctrl+TOpen a new empty tab
Alt+LeftSwitch to the previous tab
Alt+RightSwitch to the next tab
Alt+WClose the current tab (prompts to save if modified)
Ctrl+POpen 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:

# Open files in current directory $ rune . # Open files recursively (respects .gitignore) $ rune -r . # Open a specific directory $ rune src/

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.

Safety limits

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:

See the supported languages section for the full list.

Mouse Support

When enabled (the default), mouse support provides:

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

KeyAction
Ctrl+SSave file (prompts for filename if new)
Ctrl+WSave As (save with new filename)
Ctrl+Q / Ctrl+XQuit editor (prompts to save if modified)
Ctrl+HOpen help as a tab

Editing

KeyAction
Ctrl+ZUndo
Ctrl+YRedo
Ctrl+KCut line (or selection)
Alt+6Copy line (or selection)
Ctrl+UPaste
Alt+AToggle mark/selection mode
DeleteDelete character forward
Alt+}Indent selected block
Alt+{Unindent selected block
Alt+;Toggle comment (language-aware: //, #, --)
Alt+\Word completion from buffer
Alt+VVerbatim input (insert literal control character)
Ctrl+EExecute shell command

Navigation

KeyAction
Arrow keysMove cursor
Ctrl+Left/RightJump by word
Home / EndStart / end of line
Ctrl+Home / Ctrl+EndStart / end of file
Ctrl+GGo to line number
Alt+]Jump to matching bracket
Ctrl+CShow cursor position info
Page Up / Page DownScroll by page
Ctrl+V / Ctrl+YPage down / Page up (nano-style)
Mouse clickPosition cursor
Mouse scrollScroll document

Search and Replace

KeyAction
Ctrl+FFind (incremental search with live highlighting)
Ctrl+RReplace (within find mode)
Ctrl+\Replace (nano-compatible direct entry)
Up/Down in searchNavigate between matches
EscCancel search, return to original position

Tabs

KeyAction
Ctrl+TOpen new tab
Alt+Left / Alt+RightSwitch to previous / next tab
Alt+WClose current tab
Ctrl+PFuzzy finder (jump between tabs)

View

KeyAction
Ctrl+BToggle hex view
Alt+PToggle whitespace display
Ctrl+OOptions 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

# ~/.config/rune/config.toml mouse_enabled = true # Enable/disable mouse support show_line_numbers = false # Show/hide line numbers tab_width = 4 # Tab width: 2, 4, or 8 word_wrap = false # Enable/disable word wrap

All configuration options

KeyTypeDefaultDescription
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:

KeyOption
MToggle mouse mode
LToggle line numbers
WToggle word wrap
TCycle 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.

LanguageExtensionsComment 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#
DockerfileDockerfile#
Performance

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.