Skip to main content

Modeless Editor

A Sublime / VS Code-style cheatsheet for Rune's modeless editor. Typing inserts text; modifiers do everything else. An Emacs-style <meta-k> prefix layer is available for users coming from Emacs.

Enable it in config.yaml:

editor:
mode: "modeless"

On macOS, <meta> is the Command key. On Linux / Windows it is the Super / Windows key. See the key syntax reference for how modifiers are spelled.

Selection

Selection is extended generically: any motion held with <shift> extends the current selection. Releasing <shift> and pressing a motion clears the selection. Pressing <esc> always clears it.

KeyAction
<shift-{motion}>extend selection by motion
<esc>clear selection and search
<meta-a>select all
<meta-l>select line; repeat to extend down
<shift-meta-j>select indentation level
<meta-d>select next occurrence of word at cursor
<ctrl-w>expand selection semantically
<shift-meta-space>expand selection semantically
<ctrl-shift-w>shrink selection
<ctrl-shift-m>select enclosing (), {}, or []

Cursor motions

Characters and lines

KeyMotion
<left> <right> <up> <down>one character / line
<home>start of line
<end>end of line
<pgup> <pgdn>one viewport up / down

Word and line jumps

KeyMotion
<alt-left>previous word start
<alt-right>next word end
<meta-left>start of line (first non-blank)
<meta-right>end of line
<meta-up>first line of document
<meta-down>last line of document

Scroll without moving cursor

KeyAction
<ctrl-alt-up>scroll up
<ctrl-alt-down>scroll down
<ctrl-l>center current line
<ctrl-v>Emacs page down

Emacs-style point motion

KeyMotion
<ctrl-a>start of line
<ctrl-e>end of line
<ctrl-p>up
<ctrl-n>down
<ctrl-b>left
<ctrl-f>right
<ctrl-m>jump to matching bracket

Editing

Typing and deletion

KeyAction
any printableinsert; replaces selection if any
<space>insert space
<enter>newline (autopair-aware)
<tab>indent selection, else indent line
<shift-tab>outdent selection, else outdent line
<backspace>delete left (autopair-aware)
<delete>delete right
<ctrl-h>backspace
<ctrl-d>forward delete char
<alt-backspace>delete previous word
<alt-delete>delete to next word
<meta-delete>delete to end of line
<ctrl-k>kill to end of line
<ctrl-shift-k>kill whole line
<meta-shift-k>kill whole line
<ctrl-t>transpose selection (cut + paste)

Clipboard

KeyAction
<meta-c> <ctrl-c> <ctrl-y>copy selection
<meta-x>cut (defaults to current line if no selection)
<meta-v>paste
<shift-meta-v>paste and reindent
<alt-meta-v>cycle through paste history (immediately after a paste)

Undo / redo

KeyAction
<meta-z> <ctrl-z>undo
<meta-y> <shift-meta-z>redo

Line operations

KeyAction
<alt-shift-down> <shift-meta-d>duplicate line down
<alt-shift-up>duplicate line up
<alt-down> <ctrl-meta-down>move line down
<alt-up> <ctrl-meta-up>move line up
<ctrl-enter>insert blank line below
<ctrl-shift-enter>insert blank line above
<meta-j>join with next line

Indent and comment

KeyAction
<tab> <meta-]>indent
<shift-tab> <meta-[>outdent
<meta-/>toggle line comment
<alt-meta-/>toggle block comment

Paragraph

KeyAction
<alt-meta-q>wrap paragraph at ruler
KeyAction
<meta-f>open search
<ctrl-->next match
<ctrl-_>previous match
<esc>clear search

Replace is not bound in the modeless handler; use a Rune command.

Folds

KeyAction
<ctrl-shift-z>toggle fold under cursor
<ctrl-shift-a>toggle all folds
<alt-{> <alt-meta-[>collapse fold
<alt-}> <alt-meta-]>expand fold
<meta-k> jexpand all folds
<meta-k> 1collapse all folds
<ctrl-alt-h>hide selection
<ctrl-alt-v>unhide

Macros

KeyAction
<ctrl-q>toggle macro recording (unnamed register)
<ctrl-shift-q>play macro

Emacs <meta-k> prefix

<meta-k> arms a one-shot prefix. The next keystroke runs an Emacs- style command:

SequenceAction
<meta-k> <space>set mark at cursor
<meta-k> aselect from mark to cursor
<meta-k> wcut from mark to cursor
<meta-k> xswap point and mark
<meta-k> gclear mark
<meta-k> uuppercase selection
<meta-k> llowercase selection
<meta-k> kkill to end of line
<meta-k> <backspace>kill to start of line
<meta-k> jexpand all folds
<meta-k> 1collapse all folds

There is no <ctrl-x> prefix in modeless. <ctrl-x> is unbound; the cut binding is <meta-x>.

Auto-pair

When autoPair is on (default), typing one of (, [, {, ", ' inserts the matching close. <enter> and <backspace> inside an empty pair behave as expected (split block, delete pair).

Bracketed paste

Pasting from the terminal is detected and inserted verbatim as a single text run, with no auto-indent rewriting, no autopair-injected closers.

Command Prompt

<shift-meta-p> is the modeless bootstrap default for the Command Prompt. See the prompt guide for how to run commands, bind aliases, and pass arguments.

What's not here

The modeless handler intentionally does not implement:

  • Multi-cursor editing.
  • A <ctrl-x> Emacs prefix layer (use <meta-k> instead).
  • <ctrl-u> kill-to-line-start (use <meta-k> <backspace>).
  • Built-in in-buffer replace UI.
  • Completion popup (the modeless handler does not own a completion layer; completion lives in language extensions).
  • Goto-line (use the Command Prompt).

If you find a Sublime / VS Code / Emacs binding you expected and it isn't on this page, it probably isn't implemented; please open an issue with the keystroke and the buffer state where you expected it to work.

Ask Rune Agent