Common Editor and REPL Key Bindings

In the tables below, Ctrl is the Control key; Alt is the Alt (or Meta) key; Esc is the Escape key. To type Ctrl+a, hold down the Control key and press a. To type Alt+n, hold down the Alt key and press n. To type Esc p, press and release the Escape key, then press p. For convenience, some commands can be invoked by more than one key sequence.

Some commands move the cursor or select regions by S-expressions. An S-expression is a parenthesized form in which the parentheses and/or brackets are matched. For example, (a [b c] (d e f)) is an S-expression containing two nested S-expressions.

Cursor movement

KeyAction
Ctrl+gGo to line
UpMove cursor up one line
Ctrl+p   "
DownMove cursor down one line
Ctrl+n   "
LeftMove cursor left one character
Ctrl+b   "
RightMove cursor right one character
Ctrl+f   "
HomeMove cursor to beginning of line
Ctrl+a   "
EndMove cursor to end of line
Ctrl+e   "
Ctrl+9Move left to start of S-expression
Ctrl+0Move right to start of S-expression

Selecting text

Keys for selecting text enter selection mode if selection is not active, and they extend the selection in the direction indicated. Entering or deleting text while other text is selected causes the selected text to be deleted.

KeyAction
Shift+UpExtend selection one line up
Shift+DownExtend selection one line down
Shift+LeftExtend selection one character to the left
Shift+RightExtend selection one character to the right
Shift+HomeExtend selection to start of line
Shift+EndExtend selection to end of line
Shift+(Select S-expression left
Shift+)Select S-expression right
Alt+cCopy selected text to clipboard
Alt+vPaste text from clipboard
Alt+xCut selected text and place on clipboard

Deleting text

KeyAction
DeleteDelete character to right of cursor (or selection)
Ctrl+d   "
BackspaceDelete character to left of cursor (or selection)
Ctrl+h   "
Ctrl+kDelete from cursor to end of line
Ctrl+yYank text cut via Ctrl+k
Ctrl+uDelete entire line

Ctrl+k can be repeated to cut multiple lines as a unit. Pressing Ctrl+y inserts the cut lines at the current cursor position.

Undo and Redo

KeyAction
Ctrl+zUndo last change
Alt+zRedo last change

Pressing Ctrl+z repeatedly will undo multiple changes. Pressing Alt+z repeatedly will redo multiple changes.

Searching

Press Ctrl+s or Ctrl+r to start the string search. Enter a string to be searched in the search window that appears above the main Editor or REPL window. Press Enter to start the search or Esc to abort the search. Matching text is highlighed in orange. Press Ctrl+s or Ctrl+r to find additional matches. Press any other key (e.g., Ctrl+F) to terminate the search.

Other Bindings

KeyAction
TabIndent current line
Alt+nNew edit window
Alt+oOpen file in new edit window
Alt+qClose this window