Commands

Command mode can be activated by pressing :. The built-in commands are:

NameDescription
:quit, :qClose the current view.
:quit!, :q!Force close the current view, ignoring unsaved changes.
:open, :oOpen a file from disk into the current view.
:buffer-close, :bc, :bcloseClose the current buffer.
:buffer-close!, :bc!, :bclose!Close the current buffer forcefully, ignoring unsaved changes.
:buffer-close-others, :bco, :bcloseotherClose all buffers but the currently focused one.
:buffer-close-others!, :bco!, :bcloseother!Force close all buffers but the currently focused one.
:buffer-close-all, :bca, :bcloseallClose all buffers without quitting.
:buffer-close-all!, :bca!, :bcloseall!Force close all buffers ignoring unsaved changes without quitting.
:buffer-next, :bn, :bnextGoto next buffer.
:buffer-previous, :bp, :bprevGoto previous buffer.
:write, :wWrite changes to disk. Accepts an optional path (:write some/path.txt)
:write!, :w!Force write changes to disk creating necessary subdirectories. Accepts an optional path (:write some/path.txt)
:new, :nCreate a new scratch buffer.
:format, :fmtFormat the file using the LSP formatter.
:indent-styleSet the indentation style for editing. ('t' for tabs or 1-8 for number of spaces.)
:line-endingSet the document's default line ending. Options: crlf, lf.
:earlier, :earJump back to an earlier point in edit history. Accepts a number of steps or a time span.
:later, :latJump to a later point in edit history. Accepts a number of steps or a time span.
:write-quit, :wq, :xWrite changes to disk and close the current view. Accepts an optional path (:wq some/path.txt)
:write-quit!, :wq!, :x!Write changes to disk and close the current view forcefully. Accepts an optional path (:wq! some/path.txt)
:write-all, :waWrite changes from all buffers to disk.
:write-quit-all, :wqa, :xaWrite changes from all buffers to disk and close all views.
:write-quit-all!, :wqa!, :xa!Write changes from all buffers to disk and close all views forcefully (ignoring unsaved changes).
:quit-all, :qaClose all views.
:quit-all!, :qa!Force close all views ignoring unsaved changes.
:cquit, :cqQuit with exit code (default 1). Accepts an optional integer exit code (:cq 2).
:cquit!, :cq!Force quit with exit code (default 1) ignoring unsaved changes. Accepts an optional integer exit code (:cq! 2).
:themeChange the editor theme (show current theme if no name specified).
:clipboard-yankYank main selection into system clipboard.
:clipboard-yank-joinYank joined selections into system clipboard. A separator can be provided as first argument. Default value is newline.
:primary-clipboard-yankYank main selection into system primary clipboard.
:primary-clipboard-yank-joinYank joined selections into system primary clipboard. A separator can be provided as first argument. Default value is newline.
:clipboard-paste-afterPaste system clipboard after selections.
:clipboard-paste-beforePaste system clipboard before selections.
:clipboard-paste-replaceReplace selections with content of system clipboard.
:primary-clipboard-paste-afterPaste primary clipboard after selections.
:primary-clipboard-paste-beforePaste primary clipboard before selections.
:primary-clipboard-paste-replaceReplace selections with content of system primary clipboard.
:show-clipboard-providerShow clipboard provider name in status bar.
:change-current-directory, :cdChange the current working directory.
:show-directory, :pwdShow the current working directory.
:encodingSet encoding. Based on https://encoding.spec.whatwg.org.
:character-info, :charGet info about the character under the primary cursor.
:reloadDiscard changes and reload from the source file.
:reload-allDiscard changes and reload all documents from the source files.
:updateWrite changes only if the file has been modified.
:lsp-workspace-commandOpen workspace command picker
:lsp-restartRestarts the Language Server that is in use by the current doc
:tree-sitter-scopesDisplay tree sitter scopes, primarily for theming and development.
:debug-start, :dbgStart a debug session from a given template with given parameters.
:debug-remote, :dbg-tcpConnect to a debug adapter by TCP address and start a debugging session from a given template with given parameters.
:debug-evalEvaluate expression in current debug context.
:vsplit, :vsOpen the file in a vertical split.
:vsplit-new, :vnewOpen a scratch buffer in a vertical split.
:hsplit, :hs, :spOpen the file in a horizontal split.
:hsplit-new, :hnewOpen a scratch buffer in a horizontal split.
:tutorOpen the tutorial.
:goto, :gGoto line number.
:set-language, :langSet the language of current buffer (show current language if no value specified).
:set-option, :setSet a config option at runtime.
For example to disable smart case search, use :set search.smart-case false.
:toggle-option, :toggleToggle a boolean config option at runtime.
For example to toggle smart case search, use :toggle search.smart-case.
:get-option, :getGet the current value of a config option.
:sortSort ranges in selection.
:rsortSort ranges in selection in reverse order.
:reflowHard-wrap the current selection of lines to a given width.
:tree-sitter-subtree, :ts-subtreeDisplay tree sitter subtree under cursor, primarily for debugging queries.
:config-reloadRefresh user config.
:config-openOpen the user config.toml file.
:log-openOpen the helix log file.
:insert-outputRun shell command, inserting output before each selection.
:append-outputRun shell command, appending output after each selection.
:pipePipe each selection to the shell command.
:pipe-toPipe each selection to the shell command, ignoring output.
:run-shell-command, :shRun a shell command