<labelid="sidebar-toggle"class="icon-button"for="sidebar-toggle-anchor"title="Toggle Table of Contents"aria-label="Toggle Table of Contents"aria-controls="sidebar">
<ahref="https://github.com/helix-editor/helix/edit/master/book/src/commands.md"title="Suggest an edit"aria-label="Suggest an edit">
<iid="git-edit-button"class="fa fa-edit"></i>
</a>
</div>
</div>
<divid="search-wrapper"class="hidden">
<formid="searchbar-outer"class="searchbar-outer">
<inputtype="search"id="searchbar"name="searchbar"placeholder="Search this book ..."aria-controls="searchresults-outer"aria-describedby="searchresults-header">
<p>Typable commands are used from command mode and may take arguments. Command mode can be activated by pressing <code>:</code>. The built-in typable commands are:</p>
<tr><td><code>:buffer-close</code>, <code>:bc</code>, <code>:bclose</code></td><td>Close the current buffer.</td></tr>
<tr><td><code>:buffer-close!</code>, <code>:bc!</code>, <code>:bclose!</code></td><td>Close the current buffer forcefully, ignoring unsaved changes.</td></tr>
<tr><td><code>:buffer-close-others</code>, <code>:bco</code>, <code>:bcloseother</code></td><td>Close all buffers but the currently focused one.</td></tr>
<tr><td><code>:buffer-close-others!</code>, <code>:bco!</code>, <code>:bcloseother!</code></td><td>Force close all buffers but the currently focused one.</td></tr>
<tr><td><code>:buffer-close-all</code>, <code>:bca</code>, <code>:bcloseall</code></td><td>Close all buffers without quitting.</td></tr>
<tr><td><code>:buffer-close-all!</code>, <code>:bca!</code>, <code>:bcloseall!</code></td><td>Force close all buffers ignoring unsaved changes without quitting.</td></tr>
<tr><td><code>:buffer-next</code>, <code>:bn</code>, <code>:bnext</code></td><td>Goto next buffer.</td></tr>
<tr><td><code>:write</code>, <code>:w</code></td><td>Write changes to disk. Accepts an optional path (:write some/path.txt)</td></tr>
<tr><td><code>:write!</code>, <code>:w!</code></td><td>Force write changes to disk creating necessary subdirectories. Accepts an optional path (:write! some/path.txt)</td></tr>
<tr><td><code>:write-buffer-close</code>, <code>:wbc</code></td><td>Write changes to disk and closes the buffer. Accepts an optional path (:write-buffer-close some/path.txt)</td></tr>
<tr><td><code>:write-buffer-close!</code>, <code>:wbc!</code></td><td>Force write changes to disk creating necessary subdirectories and closes the buffer. Accepts an optional path (:write-buffer-close! some/path.txt)</td></tr>
<tr><td><code>:new</code>, <code>:n</code></td><td>Create a new scratch buffer.</td></tr>
<tr><td><code>:indent-style</code></td><td>Set the indentation style for editing. ('t' for tabs or 1-16 for number of spaces.)</td></tr>
<tr><td><code>:line-ending</code></td><td>Set the document's default line ending. Options: crlf, lf.</td></tr>
<tr><td><code>:earlier</code>, <code>:ear</code></td><td>Jump back to an earlier point in edit history. Accepts a number of steps or a time span.</td></tr>
<tr><td><code>:later</code>, <code>:lat</code></td><td>Jump to a later point in edit history. Accepts a number of steps or a time span.</td></tr>
<tr><td><code>:write-quit</code>, <code>:wq</code>, <code>:x</code></td><td>Write changes to disk and close the current view. Accepts an optional path (:wq some/path.txt)</td></tr>
<tr><td><code>:write-quit!</code>, <code>:wq!</code>, <code>:x!</code></td><td>Write changes to disk and close the current view forcefully. Accepts an optional path (:wq! some/path.txt)</td></tr>
<tr><td><code>:write-all</code>, <code>:wa</code></td><td>Write changes from all buffers to disk.</td></tr>
<tr><td><code>:write-all!</code>, <code>:wa!</code></td><td>Forcefully write changes from all buffers to disk creating necessary subdirectories.</td></tr>
<tr><td><code>:write-quit-all</code>, <code>:wqa</code>, <code>:xa</code></td><td>Write changes from all buffers to disk and close all views.</td></tr>
<tr><td><code>:write-quit-all!</code>, <code>:wqa!</code>, <code>:xa!</code></td><td>Write changes from all buffers to disk and close all views forcefully (ignoring unsaved changes).</td></tr>
<tr><td><code>:quit-all</code>, <code>:qa</code></td><td>Close all views.</td></tr>
<tr><td><code>:quit-all!</code>, <code>:qa!</code></td><td>Force close all views ignoring unsaved changes.</td></tr>
<tr><td><code>:cquit</code>, <code>:cq</code></td><td>Quit with exit code (default 1). Accepts an optional integer exit code (:cq 2).</td></tr>
<tr><td><code>:cquit!</code>, <code>:cq!</code></td><td>Force quit with exit code (default 1) ignoring unsaved changes. Accepts an optional integer exit code (:cq! 2).</td></tr>
<tr><td><code>:theme</code></td><td>Change the editor theme (show current theme if no name specified).</td></tr>
<tr><td><code>:yank-join</code></td><td>Yank joined selections. A separator can be provided as first argument. Default value is newline.</td></tr>
<tr><td><code>:clipboard-yank</code></td><td>Yank main selection into system clipboard.</td></tr>
<tr><td><code>:clipboard-yank-join</code></td><td>Yank joined selections into system clipboard. A separator can be provided as first argument. Default value is newline.</td></tr>
<tr><td><code>:primary-clipboard-yank</code></td><td>Yank main selection into system primary clipboard.</td></tr>
<tr><td><code>:primary-clipboard-yank-join</code></td><td>Yank joined selections into system primary clipboard. A separator can be provided as first argument. Default value is newline.</td></tr>
<tr><td><code>:clipboard-paste-after</code></td><td>Paste system clipboard after selections.</td></tr>
<tr><td><code>:clipboard-paste-before</code></td><td>Paste system clipboard before selections.</td></tr>
<tr><td><code>:clipboard-paste-replace</code></td><td>Replace selections with content of system clipboard.</td></tr>
<tr><td><code>:primary-clipboard-paste-after</code></td><td>Paste primary clipboard after selections.</td></tr>
<tr><td><code>:primary-clipboard-paste-before</code></td><td>Paste primary clipboard before selections.</td></tr>
<tr><td><code>:primary-clipboard-paste-replace</code></td><td>Replace selections with content of system primary clipboard.</td></tr>
<tr><td><code>:show-clipboard-provider</code></td><td>Show clipboard provider name in status bar.</td></tr>
<tr><td><code>:change-current-directory</code>, <code>:cd</code></td><td>Change the current working directory.</td></tr>
<tr><td><code>:show-directory</code>, <code>:pwd</code></td><td>Show the current working directory.</td></tr>
<tr><td><code>:encoding</code></td><td>Set encoding. Based on <code>https://encoding.spec.whatwg.org</code>.</td></tr>
<tr><td><code>:character-info</code>, <code>:char</code></td><td>Get info about the character under the primary cursor.</td></tr>
<tr><td><code>:reload</code>, <code>:rl</code></td><td>Discard changes and reload from the source file.</td></tr>
<tr><td><code>:reload-all</code>, <code>:rla</code></td><td>Discard changes and reload all documents from the source files.</td></tr>
<tr><td><code>:update</code>, <code>:u</code></td><td>Write changes only if the file has been modified.</td></tr>
<tr><td><code>:lsp-restart</code></td><td>Restarts the language servers used by the current doc</td></tr>
<tr><td><code>:lsp-stop</code></td><td>Stops the language servers that are used by the current doc</td></tr>
<tr><td><code>:tree-sitter-scopes</code></td><td>Display tree sitter scopes, primarily for theming and development.</td></tr>
<tr><td><code>:tree-sitter-highlight-name</code></td><td>Display name of tree-sitter highlight scope under the cursor.</td></tr>
<tr><td><code>:debug-start</code>, <code>:dbg</code></td><td>Start a debug session from a given template with given parameters.</td></tr>
<tr><td><code>:debug-remote</code>, <code>:dbg-tcp</code></td><td>Connect to a debug adapter by TCP address and start a debugging session from a given template with given parameters.</td></tr>
<tr><td><code>:debug-eval</code></td><td>Evaluate expression in current debug context.</td></tr>
<tr><td><code>:vsplit</code>, <code>:vs</code></td><td>Open the file in a vertical split.</td></tr>
<tr><td><code>:vsplit-new</code>, <code>:vnew</code></td><td>Open a scratch buffer in a vertical split.</td></tr>
<tr><td><code>:hsplit</code>, <code>:hs</code>, <code>:sp</code></td><td>Open the file in a horizontal split.</td></tr>
<tr><td><code>:hsplit-new</code>, <code>:hnew</code></td><td>Open a scratch buffer in a horizontal split.</td></tr>
<tr><td><code>:tutor</code></td><td>Open the tutorial.</td></tr>
<tr><td><code>:goto</code>, <code>:g</code></td><td>Goto line number.</td></tr>
<tr><td><code>:set-language</code>, <code>:lang</code></td><td>Set the language of current buffer (show current language if no value specified).</td></tr>
<tr><td><code>:set-option</code>, <code>:set</code></td><td>Set a config option at runtime.<br>For example to disable smart case search, use <code>:set search.smart-case false</code>.</td></tr>
<tr><td><code>:toggle-option</code>, <code>:toggle</code></td><td>Toggle a boolean config option at runtime.<br>For example to toggle smart case search, use <code>:toggle search.smart-case</code>.</td></tr>
<tr><td><code>:get-option</code>, <code>:get</code></td><td>Get the current value of a config option.</td></tr>
<tr><td><code>:sort</code></td><td>Sort ranges in selection.</td></tr>
<tr><td><code>:rsort</code></td><td>Sort ranges in selection in reverse order.</td></tr>
<tr><td><code>:reflow</code></td><td>Hard-wrap the current selection of lines to a given width.</td></tr>
<tr><td><code>:tree-sitter-subtree</code>, <code>:ts-subtree</code></td><td>Display the smallest tree-sitter subtree that spans the primary selection, primarily for debugging queries.</td></tr>
<p>Static commands take no arguments and can be bound to keys. Static commands can also be executed from the command picker (<code><space>?</code>). The built-in static commands are:</p>
<tr><td><code>extend_search_next</code></td><td>Add next search match to selection</td><td>select: <code>n</code></td></tr>
<tr><td><code>extend_search_prev</code></td><td>Add previous search match to selection</td><td>select: <code>N</code></td></tr>
<tr><td><code>search_selection</code></td><td>Use current selection as search pattern</td><td>normal: <code><A-*></code>, select: <code><A-*></code></td></tr>
<tr><td><code>search_selection_detect_word_boundaries</code></td><td>Use current selection as the search pattern, automatically wrapping with <code>\b</code> on word boundaries</td><td>normal: <code>*</code>, select: <code>*</code></td></tr>
<tr><td><code>make_search_word_bounded</code></td><td>Modify current search to make it word bounded</td><td></td></tr>
<tr><td><code>global_search</code></td><td>Global search in workspace folder</td><td>normal: <code><space>/</code>, select: <code><space>/</code></td></tr>
<tr><td><code>extend_line</code></td><td>Select current line, if already selected, extend to another line based on the anchor</td><td></td></tr>
<tr><td><code>extend_line_below</code></td><td>Select current line, if already selected, extend to next line</td><td>normal: <code>x</code>, select: <code>x</code></td></tr>
<tr><td><code>extend_line_above</code></td><td>Select current line, if already selected, extend to previous line</td><td></td></tr>
<tr><td><code>select_line_above</code></td><td>Select current line, if already selected, extend or shrink line above based on the anchor</td><td></td></tr>
<tr><td><code>select_line_below</code></td><td>Select current line, if already selected, extend or shrink line below based on the anchor</td><td></td></tr>
<tr><td><code>extend_to_line_bounds</code></td><td>Extend selection to line bounds</td><td>normal: <code>X</code>, select: <code>X</code></td></tr>
<tr><td><code>shrink_to_line_bounds</code></td><td>Shrink selection to line bounds</td><td>normal: <code><A-x></code>, select: <code><A-x></code></td></tr>
<tr><td><code>change_selection_noyank</code></td><td>Change selection without yanking</td><td>normal: <code><A-c></code>, select: <code><A-c></code></td></tr>
<tr><td><code>collapse_selection</code></td><td>Collapse selection into single cursor</td><td>normal: <code>;</code>, select: <code>;</code></td></tr>
<tr><td><code>flip_selections</code></td><td>Flip selection cursor and anchor</td><td>normal: <code><A-;></code>, select: <code><A-;></code></td></tr>
<tr><td><code>ensure_selections_forward</code></td><td>Ensure all selections face forward</td><td>normal: <code><A-:></code>, select: <code><A-:></code></td></tr>
<tr><td><code>insert_mode</code></td><td>Insert before selection</td><td>normal: <code>i</code>, select: <code>i</code></td></tr>
<tr><td><code>append_mode</code></td><td>Append after selection</td><td>normal: <code>a</code>, select: <code>a</code></td></tr>
<tr><td><code>file_picker_in_current_buffer_directory</code></td><td>Open file picker at current buffer's directory</td><td></td></tr>
<tr><td><code>file_picker_in_current_directory</code></td><td>Open file picker at current working directory</td><td>normal: <code><space>F</code>, select: <code><space>F</code></td></tr>
<tr><td><code>smart_tab</code></td><td>Insert tab if all cursors have all whitespace to their left; otherwise, run a separate command.</td><td>insert: <code><tab></code></td></tr>
<tr><td><code>yank_to_clipboard</code></td><td>Yank selections to clipboard</td><td>normal: <code><space>y</code>, select: <code><space>y</code></td></tr>
<tr><td><code>yank_to_primary_clipboard</code></td><td>Yank selections to primary clipboard</td><td></td></tr>
<tr><td><code>yank_joined</code></td><td>Join and yank selections</td><td></td></tr>
<tr><td><code>yank_joined_to_clipboard</code></td><td>Join and yank selections to clipboard</td><td></td></tr>
<tr><td><code>yank_main_selection_to_clipboard</code></td><td>Yank main selection to clipboard</td><td>normal: <code><space>Y</code>, select: <code><space>Y</code></td></tr>
<tr><td><code>yank_joined_to_primary_clipboard</code></td><td>Join and yank selections to primary clipboard</td><td></td></tr>
<tr><td><code>yank_main_selection_to_primary_clipboard</code></td><td>Yank main selection to primary clipboard</td><td></td></tr>
<tr><td><code>replace_with_yanked</code></td><td>Replace with yanked text</td><td>normal: <code>R</code>, select: <code>R</code></td></tr>
<tr><td><code>replace_selections_with_clipboard</code></td><td>Replace selections by clipboard content</td><td>normal: <code><space>R</code>, select: <code><space>R</code></td></tr>
<tr><td><code>replace_selections_with_primary_clipboard</code></td><td>Replace selections by primary clipboard</td><td></td></tr>
<tr><td><code>paste_after</code></td><td>Paste after selection</td><td>normal: <code>p</code>, select: <code>p</code></td></tr>
<tr><td><code>paste_before</code></td><td>Paste before selection</td><td>normal: <code>P</code>, select: <code>P</code></td></tr>
<tr><td><code>paste_clipboard_after</code></td><td>Paste clipboard after selections</td><td>normal: <code><space>p</code>, select: <code><space>p</code></td></tr>
<tr><td><code>paste_clipboard_before</code></td><td>Paste clipboard before selections</td><td>normal: <code><space>P</code>, select: <code><space>P</code></td></tr>
<tr><td><code>paste_primary_clipboard_after</code></td><td>Paste primary clipboard after selections</td><td></td></tr>
<tr><td><code>paste_primary_clipboard_before</code></td><td>Paste primary clipboard before selections</td><td></td></tr>
<tr><td><code>hover</code></td><td>Show docs for item under cursor</td><td>normal: <code><space>k</code>, select: <code><space>k</code></td></tr>
<tr><td><code>select_next_sibling</code></td><td>Select next sibling in the syntax tree</td><td>normal: <code><A-n></code>, <code><A-right></code>, select: <code><A-n></code>, <code><A-right></code></td></tr>
<tr><td><code>select_prev_sibling</code></td><td>Select previous sibling the in syntax tree</td><td>normal: <code><A-p></code>, <code><A-left></code>, select: <code><A-p></code>, <code><A-left></code></td></tr>
<tr><td><code>select_all_siblings</code></td><td>Select all siblings of the current node</td><td>normal: <code><A-a></code>, select: <code><A-a></code></td></tr>
<tr><td><code>select_all_children</code></td><td>Select all children of the current node</td><td>normal: <code><A-I></code>, <code><S-A-down></code>, select: <code><A-I></code>, <code><S-A-down></code></td></tr>
<tr><td><code>jump_forward</code></td><td>Jump forward on jumplist</td><td>normal: <code><C-i></code>, <code><tab></code>, select: <code><C-i></code>, <code><tab></code></td></tr>
<tr><td><code>jump_backward</code></td><td>Jump backward on jumplist</td><td>normal: <code><C-o></code>, select: <code><C-o></code></td></tr>
<tr><td><code>save_selection</code></td><td>Save current selection to jumplist</td><td>normal: <code><C-s></code>, select: <code><C-s></code></td></tr>
<tr><td><code>jump_view_right</code></td><td>Jump to right split</td><td>normal: <code><C-w>l</code>, <code><space>wl</code>, <code><C-w><C-l></code>, <code><C-w><right></code>, <code><space>w<C-l></code>, <code><space>w<right></code>, select: <code><C-w>l</code>, <code><space>wl</code>, <code><C-w><C-l></code>, <code><C-w><right></code>, <code><space>w<C-l></code>, <code><space>w<right></code></td></tr>
<tr><td><code>jump_view_left</code></td><td>Jump to left split</td><td>normal: <code><C-w>h</code>, <code><space>wh</code>, <code><C-w><C-h></code>, <code><C-w><left></code>, <code><space>w<C-h></code>, <code><space>w<left></code>, select: <code><C-w>h</code>, <code><space>wh</code>, <code><C-w><C-h></code>, <code><C-w><left></code>, <code><space>w<C-h></code>, <code><space>w<left></code></td></tr>
<tr><td><code>swap_view_right</code></td><td>Swap with right split</td><td>normal: <code><C-w>L</code>, <code><space>wL</code>, select: <code><C-w>L</code>, <code><space>wL</code></td></tr>
<tr><td><code>swap_view_left</code></td><td>Swap with left split</td><td>normal: <code><C-w>H</code>, <code><space>wH</code>, select: <code><C-w>H</code>, <code><space>wH</code></td></tr>
<tr><td><code>swap_view_up</code></td><td>Swap with split above</td><td>normal: <code><C-w>K</code>, <code><space>wK</code>, select: <code><C-w>K</code>, <code><space>wK</code></td></tr>
<tr><td><code>swap_view_down</code></td><td>Swap with split below</td><td>normal: <code><C-w>J</code>, <code><space>wJ</code>, select: <code><C-w>J</code>, <code><space>wJ</code></td></tr>
<tr><td><code>dap_edit_condition</code></td><td>Edit breakpoint condition on current line</td><td>normal: <code><space>G<C-c></code>, select: <code><space>G<C-c></code></td></tr>
<tr><td><code>dap_edit_log</code></td><td>Edit breakpoint log message on current line</td><td>normal: <code><space>G<C-l></code>, select: <code><space>G<C-l></code></td></tr>
<tr><td><code>dap_switch_thread</code></td><td>Switch current thread</td><td>normal: <code><space>Gst</code>, select: <code><space>Gst</code></td></tr>