Commands#

Enter command mode with :. Any command below can be run by name; the Aliases column lists additional names. Descriptions come from each command’s built-in documentation.

File#

CommandAliasesDescription
writewWrite changes to disk. Accepts an optional path
write!w!Force write changes to disk, creating subdirectories
write-allwaWrite changes from all buffers to disk
write-all!wa!Force write all buffers, creating subdirectories
write-quitwqWrite all documents and quit
write-quit!wq!Write all documents and quit, discarding scratch buffers
write-buffer-closewbcWrite changes to disk and close the buffer
write-buffer-close!wbc!Force write and close the buffer, creating subdirectories
updateuWrite changes only if the file has been modified
openo, edit, eOpen a file from disk into the current view
newnCreate a new scratch buffer
reloadrlDiscard changes and reload from the source file
reload-allrlaDiscard changes and reload all documents from disk
movemvMove the current buffer and its file to a different path
move!mv!Move the buffer and its file, creating subdirectories
readrLoad a file into buffer

Clean buffers reload automatically after external changes. Dirty buffers remain untouched; use reload, reload-all, or write to resolve them.

Buffer#

CommandAliasesDescription
buffer-closebc, bcloseClose the current buffer
buffer-close-forcebuffer-close!, bc!, bclose!Close the current buffer, ignoring unsaved changes
buffer-close-othersbco, bcloseotherClose all buffers but the currently focused one
buffer-close-allbca, bcloseallClose all buffers without quitting
buffer-nextbn, bnextGoto next buffer
buffer-previousbp, bprevGoto previous buffer
buffer-messagesmessagesGoto the message log buffer

Movement#

CommandAliasesDescription
goto-line-end-newlineGoto newline at line end
move-char-leftMove left
move-visual-line-downMove down
move-visual-line-upMove up
move-char-rightMove right
move-next-word-startMove to start of next word
move-prev-word-startMove to start of previous word
move-next-word-endMove to end of next word
move-prev-word-endMove to end of previous word
move-next-long-word-startMove to start of next long word
move-prev-long-word-startMove to start of previous long word
move-next-long-word-endMove to end of next long word
move-prev-long-word-endMove to end of previous long word
move-next-sub-word-startMove to start of next sub-word
move-prev-sub-word-startMove to start of previous sub-word
move-next-sub-word-endMove to end of next sub-word
move-prev-sub-word-endMove to end of previous sub-word
goto-line-startGoto line start
goto-line-endGoto line end
find-next-charMove to next occurrence of char
find-till-charMove till next occurrence of char
find-prev-charMove to previous occurrence of char
till-prev-charMove till previous occurrence of char
goto-lineGoto line
goto-line-or-file-startGoto line number <n> else file start
goto-fileGoto files/URLs in selections
goto-columnGoto column
goto-window-topGoto window top
goto-window-centerGoto window center
goto-window-bottomGoto window bottom
goto-last-lineGoto last line
goto-first-nonwhitespaceGoto first non-blank in line
goto-last-accessed-fileGoto last accessed file
goto-last-modified-fileGoto last modified file
goto-last-modificationGoto last modification
jump-forwardJump forward on jumplist
jump-backwardJump backward on jumplist
save-selectionSave current selection to jumplist
goto-next-paragraphGoto next paragraph
goto-prev-paragraphGoto previous paragraph
goto-line-or-extend-file-startExtend to line number <n> else file start
repeat-last-motionRepeat last motion
match-bracketsGoto matching bracket
gotogGoto a path:line:col location

Selection#

CommandAliasesDescription
extend-char-leftExtend left
extend-visual-line-downExtend down
extend-visual-line-upExtend up
extend-char-rightExtend right
extend-next-word-startExtend to start of next word
extend-prev-word-startExtend to start of previous word
extend-next-word-endExtend to end of next word
extend-prev-word-endExtend to end of previous word
extend-next-long-word-startExtend to start of next long word
extend-prev-long-word-startExtend to start of previous long word
extend-next-long-word-endExtend to end of next long word
extend-prev-long-word-endExtend to end of previous long word
extend-next-sub-word-startExtend to start of next sub-word
extend-prev-sub-word-startExtend to start of previous sub-word
extend-next-sub-word-endExtend to end of next sub-word
extend-prev-sub-word-endExtend to end of previous sub-word
extend-next-charExtend to next occurrence of char
extend-till-charExtend till next occurrence of char
extend-prev-charExtend to previous occurrence of char
extend-till-prev-charExtend till previous occurrence of char
extend-to-line-startExtend to line start
extend-to-line-endExtend to line end
extend-to-line-end-newlineExtend to line end including newline
extend-to-first-nonwhitespaceExtend to first non-blank in line
extend-to-columnExtend to column
extend-to-last-lineExtend to last line
extend-to-file-endExtend to file end
copy-on-next-lineCopy selection on next line
copy-on-prev-lineCopy selection on previous line
select-within-regexSelect all regex matches inside selections
split-selection-by-regexSplit selections on regex matches
keep-selections-matchingKeep selections matching regex
remove-selections-matchingRemove selections matching regex
split-selection-on-newlineSplit selection on newlines
merge-selectionsMerge selections
merge-consecutive-selectionsMerge consecutive selections
collapse-selectionCollapse selection into single cursor
flip-selectionsFlip selection cursor and anchor
select-allSelect whole document
select-line-aboveSelect line above
select-line-belowSelect line below
extend-line-belowSelect the current line, or extend to the next line
extend-to-line-boundsExtend selection to line bounds
shrink-to-line-boundsShrink selection to line bounds
expand-selectionExpand selection to syntax node
shrink-selectionShrink selection to syntax node
keep-primary-selectionKeep primary selection
remove-primary-selectionRemove primary selection
surround-addSurround add
surround-replaceSurround replace
surround-deleteSurround delete
select-textobject-aroundSelect around object
select-textobject-innerSelect inside object

Editing#

CommandAliasesDescription
commit-undo-checkpointCommit changes to new checkpoint
delete-word-backwardDelete previous word
delete-word-forwardDelete next word
kill-to-line-startDelete till start of line
kill-to-line-endDelete till end of line
delete-char-backwardDelete previous char
delete-char-forwardDelete next char
insert-newlineInsert newline char
smart-tabInsert tab in leading whitespace; else move past the node
insert-tabInsert tab at each cursor
replaceReplace with new char
delete-selectionDelete selection
delete-selection-noyankDelete selection without yanking
change-selectionChange selection
change-selection-noyankChange selection without yanking
switch-caseSwitch (toggle) case
switch-to-lowercaseSwitch to lowercase
switch-to-uppercaseSwitch to uppercase
indentIndent selection
unindentUnindent selection
join-selectionsJoin lines inside selection
join-selections-spaceJoin lines inside selection and select spaces
align-selectionsAlign selections in column
trim-selectionsTrim whitespace from selections
rotate-selections-backwardRotate selections backward
rotate-selections-forwardRotate selections forward
rotate-contents-backwardRotate selections contents backward
rotate-contents-forwardRotate selection contents forward
ensure-forwardEnsure all selections face forward
incrementIncrement item under cursor
decrementDecrement item under cursor
add-newline-aboveAdd newline above
add-newline-belowAdd newline below

Undo History#

CommandAliasesDescription
undoUndo change
redoRedo change
earlierMove backward in history. Accepts a number of steps
laterMove forward in history. Accepts a number of steps

Modes#

CommandAliasesDescription
select-modeEnter selection extend mode
normal-modeEnter normal mode
insert-modeInsert before selection
insert-at-line-startInsert at start of line
append-modeAppend after selection
append-to-lineInsert at end of line
open-belowOpen new line below selection
open-aboveOpen new line above selection
enter-command-modeEnter command mode

Comments#

CommandAliasesDescription
toggle-commentsComment/uncomment selections
toggle-line-commentsLine comment/uncomment selections
toggle-block-commentsBlock comment/uncomment selections
CommandAliasesDescription
search-forwardSearch for regex pattern
search-backwardReverse search for regex pattern
search-nextSelect next search match
search-prevSelect previous search match
search-selection-wordSearch for the selection, wrapped on word boundaries
make-search-word-boundedModify current search to make it word bounded
search-selectionUse current selection as search pattern
extend-search-nextAdd next search match to selection
extend-search-prevAdd previous search match to selection

Completion#

CommandAliasesDescription
completionComplete current word
completion-acceptAccept completion
completion-cancelCancel completion
completion-previousPrevious completion
completion-nextNext completion
completion-page-upPrevious completion page
completion-page-downNext completion page
completion-firstFirst completion
completion-lastLast completion

Registers#

CommandAliasesDescription
insert-registerInsert register
select-registerSelect register
clear-registerClear the given register, or all registers if none is given

Macros#

CommandAliasesDescription
record-macroRecord macro
replay-macroReplay macro

Clipboard#

CommandAliasesDescription
yankclipboard-yankYank selection to clipboard or register
yank-main-selectionYank main selection to clipboard or register
paste-afterclipboard-paste-afterPaste clipboard or register after selection
paste-beforeclipboard-paste-beforePaste clipboard or register before selection
replace-with-yankedReplace selection with clipboard or register
yank-joinYank joined selections. First argument sets the separator
yank-to-primary-clipboardprimary-clipboard-yankYank selections to primary clipboard
paste-primary-clipboard-afterprimary-clipboard-paste-afterPaste primary clipboard after selections
paste-primary-clipboard-beforeprimary-clipboard-paste-beforePaste primary clipboard before selections
primary-clipboard-paste-replaceReplace selections by primary clipboard

Shell#

CommandAliasesDescription
shell-pipePipe selections through shell command
shell-insert-outputInsert shell command output before selections
shell-keep-pipeFilter selections with shell predicate
shell-pipe-toPipe selections into shell command ignoring output
shell-append-outputAppend shell command output after selections

Format#

CommandAliasesDescription
formatfmtFormat the file with an external formatter or LSP
format-selectionsFormat selection
reflowHard-wrap the current selection of lines to a given width
sortSort ranges in selection

Windows and Splits#

CommandAliasesDescription
vsplitvsVertical right split. Opens the given files in the split
hsplitsplit, hs, spHorizontal bottom split. Opens the given files in the split
vsplit-newvnewVertical right split scratch buffer
hsplit-newhnewHorizontal bottom split scratch buffer
transpose-viewTranspose splits
wclosewcClose window
wclose!wc!Force close window
wonlywoClose windows except current
rotate-viewGoto next window
toggle-pane-maximizedToggle focused pane maximized
jump-view-leftJump to left split
jump-view-downJump to split below
jump-view-upJump to split above
jump-view-rightJump to right split
swap-view-leftSwap with left split
swap-view-downSwap with split below
swap-view-upSwap with split above
swap-view-rightSwap with right split
resize-viewResize split

Splitting a document or image pane creates another view of the same document or image. Splitting a terminal starts a new shell. Ctrl+w z temporarily maximizes the focused pane; press it again to restore the preserved split layout.

View and Scroll#

CommandAliasesDescription
page-upMove page up
page-downMove page down
page-cursor-half-upMove page and cursor half up
page-cursor-half-downMove page and cursor half down
half-page-upMove half page up
half-page-downMove half page down
page-cursor-upMove page and cursor up
page-cursor-downMove page and cursor down
center-cursor-lineAlign view center
align-view-topAlign view top
align-view-bottomAlign view bottom
scroll-upScroll view up
scroll-downScroll view down

Terminal#

CommandAliasesDescription
paste-clipboard-into-panePaste clipboard into terminal
terminalOpen a new terminal
terminal-searchSearch focused terminal’s scrollback

Image#

CommandAliasesDescription
image-zoom-inzoom-inZoom image in
image-zoom-outzoom-outZoom image out
image-zoom-resetzoom-resetFit image to pane
image-pan-leftpan-leftPan image left
image-pan-downpan-downPan image down
image-pan-uppan-upPan image up
image-pan-rightpan-rightPan image right

Pickers#

CommandAliasesDescription
symbol-pickerOpen symbol picker
workspace-symbol-pickerOpen workspace symbol picker
file-pickerOpen file picker
file-picker-in-current-dirOpen file picker at current working directory
file-explorerOpen file explorer at workspace root
file-explorer-in-current-pane-dirOpen file explorer at current pane’s directory
buffer-pickerOpen buffer picker
jumplist-pickerOpen jumplist picker
diagnostic-pickerOpen diagnostic picker
workspace-diagnostics-pickerOpen workspace diagnostic picker
global-searchGlobal search in workspace folder
command-paletteOpen command palette
last-pickerReopen the last picker
changed-file-pickerOpen changed file picker

Language Server#

CommandAliasesDescription
goto-declarationGoto declaration
goto-definitionGoto definition
goto-type-definitionGoto type definition
goto-implementationGoto implementation
goto-referenceGoto references
select-references-to-symbol-under-cursorSelect symbol references
code-actionPerform code action
hoverShow docs for item under cursor
rename-symbolRename symbol
signature-helpShow signature help
lsp-restartRestart the given language servers, or all for this document
lsp-stopStop the given language servers, or all for this document
lsp-workspace-commandExecute a language server workspace command

Version Control#

CommandAliasesDescription
goto-next-changeGoto next change
goto-prev-changeGoto previous change
goto-first-changeGoto first change
goto-last-changeGoto last change
reset-diff-changediff-resetReset the diff changes under the selections

Directory#

CommandAliasesDescription
change-directorychange-current-directory, cdChange the current working directory
show-directorypwdShow the current working directory
show-directory-stackShow the directory stack as a space delimited string
push-directorypushdSave and then change the current directory
pop-directorypopdRemove the top directory stack entry and cd to the new top

Config#

CommandAliasesDescription
get-optiongetGet the current value of a config option
set-optionsetSet a config option at runtime
toggle-optiontoggleToggle a config option at runtime
config-openOpen the user config.toml file
config-open-workspaceOpen the workspace config.toml file
config-reloadRefresh user config
log-openOpen the editor log file
workspace-trustAdd current workspace to the list of trusted workspaces
workspace-untrustRemove current workspace from the list of trusted workspaces
themeChange the editor theme (show current if no name specified)
set-languagelangSet the buffer’s language (show current if not specified)
set-line-endingline-endingSet the document’s line ending: crlf, lf, or native
indent-styleSet the indentation style (’t’ for tabs, or 1-16 spaces)

Session#

CommandAliasesDescription
save-sessionSave session to the workspace session file
restore-sessionRestore session from the workspace session file

Quit#

CommandAliasesDescription
quitqQuit if all documents are saved
quit!q!Quit, ignoring unsaved changes

Support#

CommandAliasesDescription
aboutShow version and license information
character-infocharGet info about the character under the primary cursor
echoPrints the given arguments to the status line
redrawClear and re-render the whole UI