Skip to content

Builtin Commands ​

These are editor commands, reached from a key binding or from a plugin with (call! …), never from the command mode prompt. (Typed commands are listed on the Command mode page instead, and plain Scheme functions such as insert-key! on the Plugin API page.) Every command below is built into the editor, not a plugin. They are callable two ways from Scheme:

scheme
;; directly, as a bare binding
(move-left pane)
;; or through the generic dispatcher, like a plugin command
(call! "move-left" pane)

Most builtins act through whatever pane pane names (not necessarily the one you're focused on, as long as it's still open and still shows the buffer pane names), so a hook or a timer can act on a pane you aren't currently looking at. A few commands require pane to be the one you're actually focused on: entering insert mode, opening a search or command prompt, toggling extend mode, paste and paste-cycling, opening or switching tabs, and every pane-focus/split/close command. repeat-last-action runs only from a key: calling it from Scheme raises an error. Every command needs a pane that names a pane — a value with only a buffer (from (buffers), or a buffer-level hook) is refused. Either way, a pane the command can't act on errors rather than silently falling back to whatever is focused. The first form is only valid for builtins; call! works for any key-bindable command but repeat-last-action, builtin or Scheme-defined. Each entry lists the command name and what it does. For key bindings that trigger these commands, see the key reference and the per-topic pages.

Motions ​

Move the cursor/selection. Callable as (name pane) or (call! "name" pane).

CommandDefault keyEffect
find-backwardF + charFind previous occurrence of a character (inclusive, backward). From call!, pass the character as an argument.
find-forwardf + charFind next occurrence of a character (inclusive, forward). From call!, pass the character as an argument.
goto-first-lineg gMove cursors to the first character of the buffer.
goto-first-nonblankg sMove cursors to the first non-blank character on the line.
goto-last-lineg eMove cursors to the first character of the last line.
goto-line-endEnd / g lMove cursors to the last character on the line.
goto-line-startHome / g hMove cursors to the start of the line.
goto-matching-pair#Move cursors to the matching bracket or tag.
goto-next-argumentg aSelect the next argument.
goto-next-classg tSelect the next class or type.
goto-next-commentg cSelect the next comment.
goto-next-functiong fSelect the next function.
goto-next-paragraph}Select the next paragraph.
goto-next-testg uSelect the next unit test.
goto-next-valueg vSelect the next array/tuple/struct value.
goto-prev-argumentg ASelect the previous argument.
goto-prev-classg TSelect the previous class or type.
goto-prev-commentg CSelect the previous comment.
goto-prev-functiong FSelect the previous function.
goto-prev-paragraph{Select the previous paragraph.
goto-prev-testg USelect the previous unit test.
goto-prev-valueg VSelect the previous array/tuple/struct value.
jump-backwardCtrl-oNavigate to the previous position in the jump list.
jump-forwardCtrl-i / TabNavigate to the next position in the jump list.
move-downj / ↓Move cursors down one visual line (one buffer line with a count).
move-lefth / ←Move cursors one grapheme to the left.
move-rightl / →Move cursors one grapheme to the right.
move-upk / ↑Move cursors up one visual line (one buffer line with a count).
repeat-find-backward-Repeat the last find/till motion backward.
repeat-find-forward=Repeat the last find/till motion forward.
select-linex / Ctrl-xSelect the full current line (forward).
select-line-backwardX / Ctrl-Shift-xSelect the full current line (backward).
select-next-uppercase-wordWSelect the next uppercase word (whitespace-delimited).
select-next-wordwSelect the next word.
select-prev-uppercase-wordBSelect the previous uppercase word (whitespace-delimited).
select-prev-wordbSelect the previous word.
till-backwardT + charMove to just after previous occurrence of a character (exclusive). From call!, pass the character as an argument.
till-forwardt + charMove to just before next occurrence of a character (exclusive). From call!, pass the character as an argument.

Selection commands ​

Create, refine, or manipulate the selection set.

CommandDefault keyEffect
collapse-and-exit-extend;Collapse each selection to its cursor and exit extend mode.
collapse-selection—Collapse each selection to a single cursor at the head.
collapse-to-anchor-and-exit-extendCtrl-;Collapse each selection to its anchor and exit extend mode.
copy-selection-on-next-lineCDuplicate each selection on the line below.
copy-selection-on-prev-line—Duplicate each selection on the line above.
cycle-primary-backward(Cycle the primary selection backward.
cycle-primary-forward)Cycle the primary selection forward.
flip-selectionsCtrl-eSwap anchor and head for each selection.
keep-primary-selection,Remove all selections except the primary.
remove-primary-selectionCtrl-,Remove the primary selection, promoting the next.
select-all%Select the entire buffer.
select-last-insertionm i iSelect the text typed during the most recently completed insert session.
sift-withinsNarrow each selection down to its regex matches. From call!, the pattern is required.
split-selection-on-newlinesSSplit each multi-line selection into one per line.
trim-selection-whitespace_Trim leading and trailing whitespace from each selection.

Text objects ​

Select a delimited region around the cursor.

CommandDefault keyEffect
around-anglem a < / m a >Select content including the nearest <>.
around-argumentm a aSelect the argument and its separator comma. Structure-aware: uses the language's parameter object when the grammar defines one.
around-backtickm a `Select content including the nearest backtick pair.
around-bracem a { / m a }Select content including the nearest {}.
around-bracketm a [ / m a ]Select content including the nearest [].
around-classm a tSelect the class or type including its header. Requires a grammar with a textobjects.scm.
around-commentm a cSelect the whole comment block. Requires a grammar with a textobjects.scm.
around-double-quotem a "Select content including the nearest ".
around-functionm a fSelect the function including its signature (and attributes/decorators). Requires a grammar with a textobjects.scm.
around-linem a lSelect the line including its newline.
around-paragraphm a pSelect the paragraph plus its trailing blank gap.
around-parenm a ( / m a )Select content including the nearest ().
around-single-quotem a 'Select content including the nearest '.
around-testm a uSelect the whole unit test, including its attribute or decorator. Requires a grammar with a textobjects.scm.
around-uppercase-wordm a WSelect uppercase word plus one adjacent whitespace run.
around-valuem a vSelect an array/tuple/struct value plus its separator comma. Requires a grammar with a textobjects.scm.
around-wordm a wSelect word plus one adjacent whitespace run.
inner-anglem i < / m i >Select content inside the nearest <>.
inner-argumentm i aSelect the argument at the cursor (trimmed). Structure-aware: uses the language's parameter object when the grammar defines one.
inner-backtickm i `Select content inside the nearest backtick pair.
inner-bracem i { / m i }Select content inside the nearest {}.
inner-bracketm i [ / m i ]Select content inside the nearest [].
inner-classm i tSelect inside a class or type. Requires a grammar with a textobjects.scm.
inner-commentm i cSelect inside a comment. Requires a grammar with a textobjects.scm.
inner-double-quotem i "Select content inside the nearest ".
inner-functionm i fSelect inside a function. Requires a grammar with a textobjects.scm.
inner-linem i lSelect inner line content (excluding the newline).
inner-paragraphm i pSelect the paragraph's text, excluding any trailing blank gap.
inner-parenm i ( / m i )Select content inside the nearest ().
inner-single-quotem i 'Select content inside the nearest '.
inner-testm i uSelect inside a unit test function's body. Requires a grammar with a textobjects.scm.
inner-uppercase-wordm i WSelect inner uppercase word (whitespace-delimited).
inner-valuem i vSelect inside an array/tuple/struct value. Requires a grammar with a textobjects.scm.
inner-wordm i wSelect inner word.
select-uppercase-wordM MSelect the uppercase word (WORD) under the cursor.
select-wordm mSelect the word under the cursor.
select-word-nearest-on-line—Select the word under the cursor, or the nearest word on the same visual line when on whitespace; span follows word-selects-whitespace.

Surround ​

Select or wrap delimiter pairs.

CommandDefault keyEffect
surround-addm w + charWrap each selection with a delimiter pair. Reads the next typed character to determine the pair. From call!, pass the character as an argument.
surround-anglem s < / m s >Select surrounding <> delimiters.
surround-backtickm s `Select surrounding ` delimiters.
surround-bracem s { / m s }Select surrounding {} delimiters.
surround-bracketm s [ / m s ]Select surrounding [] delimiters.
surround-double-quotem s "Select surrounding " delimiters.
surround-parenm s ( / m s )Select surrounding () delimiters.
surround-single-quotem s 'Select surrounding ' delimiters.

Edits ​

Modify buffer text.

CommandDefault keyEffect
align-selections&Align each selection's anchor to the primary selection's anchor column.
changecDelete selections onto the kill ring, then enter insert mode (one undo group).
deletedDelete selections, pushing their text onto the kill ring.
delete-char-backward—Delete the character before each cursor.
delete-char-forward—Delete the character (or selection) under the cursor.
delete-selection—Delete all selections.
delete-word-backwardCtrl-w (insert mode)Delete the word before each cursor.
indent>Indent every line touched by a selection by one level.
join-lines-select-spacesJJoin lines inside each selection and select the inserted spaces.
make-text-capitalizedG CCapitalize each word in every selection (Title Case).
make-text-lowercaseG LLowercase the text in each selection.
make-text-uppercaseG UUppercase the text in each selection.
open-line-aboveOOpen a new line above the cursor and enter insert mode.
open-line-belowoOpen a new line below the cursor and enter insert mode.
replacer + charReplace every character in each selection with the next typed character. From call!, pass the character as an argument.
toggle-commentG GComment or uncomment the lines of each selection.
unindent<Unindent every line touched by a selection by one level.

Clipboard and registers ​

Move text between the buffer, the kill ring, and the system clipboard.

CommandDefault keyEffect
paste-after—Paste register contents after the selection. Bare (no "<reg> prefix) reads the kill-ring head, with no clipboard fallback.
paste-before—Paste register contents before the selection. Bare (no "<reg> prefix) reads the kill-ring head, with no clipboard fallback.
paste-ring-newer]Cycle kill ring one step newer and re-paste.
paste-ring-older[Cycle kill ring one step older and re-paste.
smart-paste-afterpPaste after the selection: kill-ring head while nothing has been edited since the last capture, clipboard otherwise.
smart-paste-beforePPaste before the selection: kill-ring head while nothing has been edited since the last capture, clipboard otherwise.
yankyCopy selections to the clipboard and kill ring without deleting.

Undo and repeat ​

Replay or roll back past changes.

CommandDefault keyEffect
redoU / Ctrl-rRedo the last undone change.
repeat-last-action.Repeat the last editing action. Only from a key: calling it from Scheme raises an error.
undouUndo the last change.

Find text and act on the matches.

CommandDefault keyEffect
clear-search—Clear search highlights. Esc also clears them; bind a key to run this directly.
search-backward?Enter search mode (backward). From call!, the pattern is required.
search-forward/Enter search mode (forward). From call!, the pattern is required.
search-nextnJump to the next search match.
search-prevNJump to the previous search match.
search-selectionCtrl-/Use the primary selection text literally as the search pattern.
search-word-under-cursor*Search the whole word under the cursor.
select-all-matchesm /Turn every search match in the buffer into a selection.

Modes ​

Switch between normal, insert, extend, and the command prompt.

CommandDefault keyEffect
command-mode:Open the command mode prompt.
completion-triggerCtrl-SpaceShow completions at the cursor (insert mode).
exit-insertEsc / Ctrl-cReturn to normal mode from insert mode.
insert-after—Enter insert mode after the cursor (move one grapheme right).
insert-at-line-endAEnter insert mode after the last character on the line.
insert-at-line-startIEnter insert mode at the first non-blank character on the line.
insert-at-selection-endaEnter insert mode after the end of the selection.
insert-at-selection-startiEnter insert mode at the start of the selection.
insert-before—Enter insert mode; collapse each selection to its start.
toggle-extendeToggle sticky extend mode.

Scrolling ​

Move the viewport without moving the cursor.

CommandDefault keyEffect
bottom-view-on-cursorz jScroll so the primary selection head sits at the bottom of the viewport.
center-view-on-cursorz zScroll so the primary selection head sits at the vertical center of the viewport.
half-page-downCtrl-dScroll down by half a viewport height.
half-page-upCtrl-uScroll up by half a viewport height.
page-downPageDownScroll down by one viewport height.
page-upPageUpScroll up by one viewport height.
top-view-on-cursorz kScroll so the primary selection head sits at the top of the viewport.

Panes, buffers, and tabs ​

Split, focus, and close panes; switch buffers; switch tabs.

CommandDefault keyEffect
goto-alternate-buffer—Switch to the most-recently-focused other buffer.
goto-next-buffer—Switch to the next buffer in open-order.
goto-next-tabCtrl-p tSwitch to the next tab in display order.
goto-prev-buffer—Switch to the previous buffer in open-order.
goto-prev-tabCtrl-p TSwitch to the previous tab in display order.
pane-closeCtrl-p cClose the focused pane.
pane-focus-downCtrl-p jFocus the pane below.
pane-focus-leftCtrl-p hFocus the pane to the left.
pane-focus-nextTab / Ctrl-p pFocus the next pane.
pane-focus-rightCtrl-p lFocus the pane to the right.
pane-focus-upCtrl-p kFocus the pane above.
pane-rotate-backwardCtrl-p RRotate the panes in the focused pane's row or column backward (that many places with a count).
pane-rotate-forwardCtrl-p rRotate the panes in the focused pane's row or column forward (that many places with a count).
pane-splitCtrl-p sSplit the focused pane, stacking the new pane below it.
pane-vsplitCtrl-p vSplit the focused pane side by side.
tab-new—Open a fresh pane viewing the focused buffer in a new tab.

Released under the MIT License.