pull/11885/head
archseer 2 years ago
parent 7621efe2e4
commit 2e0fbceab7

@ -84,7 +84,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents"> <nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox"> <div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html"><strong aria-hidden="true">2.3.</strong> Language Support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html"><strong aria-hidden="true">4.2.</strong> Key Remapping</a></li><li class="chapter-item expanded "><a href="languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding Languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding Textobject Queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding Indent Queries</a></li></ol></li></ol> <ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html"><strong aria-hidden="true">2.3.</strong> Language support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html"><strong aria-hidden="true">4.2.</strong> Key remapping</a></li><li class="chapter-item expanded "><a href="languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding textobject queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding indent queries</a></li></ol></li></ol>
</div> </div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
</nav> </nav>

@ -83,7 +83,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents"> <nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox"> <div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html" class="active"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html"><strong aria-hidden="true">2.3.</strong> Language Support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html"><strong aria-hidden="true">4.2.</strong> Key Remapping</a></li><li class="chapter-item expanded "><a href="languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding Languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding Textobject Queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding Indent Queries</a></li></ol></li></ol> <ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html" class="active"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html"><strong aria-hidden="true">2.3.</strong> Language support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html"><strong aria-hidden="true">4.2.</strong> Key remapping</a></li><li class="chapter-item expanded "><a href="languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding textobject queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding indent queries</a></li></ol></li></ol>
</div> </div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
</nav> </nav>
@ -148,7 +148,7 @@
<div id="content" class="content"> <div id="content" class="content">
<main> <main>
<h1 id="commands"><a class="header" href="#commands">Commands</a></h1> <h1 id="commands"><a class="header" href="#commands">Commands</a></h1>
<p>Command mode can be activated by pressing <code>:</code>, similar to Vim. Built-in commands:</p> <p>Command mode can be activated by pressing <code>:</code>. The built-in commands are:</p>
<div class="table-wrapper"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody> <div class="table-wrapper"><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody>
<tr><td><code>:quit</code>, <code>:q</code></td><td>Close the current view.</td></tr> <tr><td><code>:quit</code>, <code>:q</code></td><td>Close the current view.</td></tr>
<tr><td><code>:quit!</code>, <code>:q!</code></td><td>Force close the current view, ignoring unsaved changes.</td></tr> <tr><td><code>:quit!</code>, <code>:q!</code></td><td>Force close the current view, ignoring unsaved changes.</td></tr>

@ -83,7 +83,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents"> <nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox"> <div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html"><strong aria-hidden="true">2.3.</strong> Language Support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html" class="active"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html"><strong aria-hidden="true">4.2.</strong> Key Remapping</a></li><li class="chapter-item expanded "><a href="languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding Languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding Textobject Queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding Indent Queries</a></li></ol></li></ol> <ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html"><strong aria-hidden="true">2.3.</strong> Language support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html" class="active"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html"><strong aria-hidden="true">4.2.</strong> Key remapping</a></li><li class="chapter-item expanded "><a href="languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding textobject queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding indent queries</a></li></ol></li></ol>
</div> </div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
</nav> </nav>
@ -154,7 +154,7 @@
<li>Windows: <code>%AppData%\helix\config.toml</code></li> <li>Windows: <code>%AppData%\helix\config.toml</code></li>
</ul> </ul>
<blockquote> <blockquote>
<p>Hint: You can easily open the config file by typing <code>:config-open</code> within Helix normal mode.</p> <p>💡 You can easily open the config file by typing <code>:config-open</code> within Helix normal mode.</p>
</blockquote> </blockquote>
<p>Example config:</p> <p>Example config:</p>
<pre><code class="language-toml">theme = &quot;onedark&quot; <pre><code class="language-toml">theme = &quot;onedark&quot;
@ -171,31 +171,30 @@ select = &quot;underline&quot;
[editor.file-picker] [editor.file-picker]
hidden = false hidden = false
</code></pre> </code></pre>
<p>You may also specify a file to use for configuration with the <code>-c</code> or <p>You can use a custom configuration file by specifying it with the <code>-c</code> or
<code>--config</code> CLI argument: <code>hx -c path/to/custom-config.toml</code>.</p> <code>--config</code> command line argument, for example <code>hx -c path/to/custom-config.toml</code>.
<p>It is also possible to trigger configuration file reloading by sending the <code>USR1</code> Additionally, you can reload the configuration file by sending the USR1
signal to the helix process, e.g. via <code>pkill -USR1 hx</code>. This is only supported signal to the Helix process on Unix operating systems, such as by using the command <code>pkill -USR1 hx</code>.</p>
on unix operating systems.</p>
<h2 id="editor"><a class="header" href="#editor">Editor</a></h2> <h2 id="editor"><a class="header" href="#editor">Editor</a></h2>
<h3 id="editor-section"><a class="header" href="#editor-section"><code>[editor]</code> Section</a></h3> <h3 id="editor-section"><a class="header" href="#editor-section"><code>[editor]</code> Section</a></h3>
<div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Default</th></tr></thead><tbody> <div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Default</th></tr></thead><tbody>
<tr><td><code>scrolloff</code></td><td>Number of lines of padding around the edge of the screen when scrolling.</td><td><code>5</code></td></tr> <tr><td><code>scrolloff</code></td><td>Number of lines of padding around the edge of the screen when scrolling</td><td><code>5</code></td></tr>
<tr><td><code>mouse</code></td><td>Enable mouse mode.</td><td><code>true</code></td></tr> <tr><td><code>mouse</code></td><td>Enable mouse mode</td><td><code>true</code></td></tr>
<tr><td><code>middle-click-paste</code></td><td>Middle click paste support.</td><td><code>true</code></td></tr> <tr><td><code>middle-click-paste</code></td><td>Middle click paste support</td><td><code>true</code></td></tr>
<tr><td><code>scroll-lines</code></td><td>Number of lines to scroll per scroll wheel step.</td><td><code>3</code></td></tr> <tr><td><code>scroll-lines</code></td><td>Number of lines to scroll per scroll wheel step</td><td><code>3</code></td></tr>
<tr><td><code>shell</code></td><td>Shell to use when running external commands.</td><td>Unix: <code>[&quot;sh&quot;, &quot;-c&quot;]</code><br/>Windows: <code>[&quot;cmd&quot;, &quot;/C&quot;]</code></td></tr> <tr><td><code>shell</code></td><td>Shell to use when running external commands</td><td>Unix: <code>[&quot;sh&quot;, &quot;-c&quot;]</code><br/>Windows: <code>[&quot;cmd&quot;, &quot;/C&quot;]</code></td></tr>
<tr><td><code>line-number</code></td><td>Line number display: <code>absolute</code> simply shows each line's number, while <code>relative</code> shows the distance from the current line. When unfocused or in insert mode, <code>relative</code> will still show absolute line numbers.</td><td><code>absolute</code></td></tr> <tr><td><code>line-number</code></td><td>Line number display: <code>absolute</code> simply shows each line's number, while <code>relative</code> shows the distance from the current line. When unfocused or in insert mode, <code>relative</code> will still show absolute line numbers</td><td><code>absolute</code></td></tr>
<tr><td><code>cursorline</code></td><td>Highlight all lines with a cursor.</td><td><code>false</code></td></tr> <tr><td><code>cursorline</code></td><td>Highlight all lines with a cursor</td><td><code>false</code></td></tr>
<tr><td><code>cursorcolumn</code></td><td>Highlight all columns with a cursor.</td><td><code>false</code></td></tr> <tr><td><code>cursorcolumn</code></td><td>Highlight all columns with a cursor</td><td><code>false</code></td></tr>
<tr><td><code>gutters</code></td><td>Gutters to display: Available are <code>diagnostics</code> and <code>diff</code> and <code>line-numbers</code> and <code>spacer</code>, note that <code>diagnostics</code> also includes other features like breakpoints, 1-width padding will be inserted if gutters is non-empty</td><td><code>[&quot;diagnostics&quot;, &quot;spacer&quot;, &quot;line-numbers&quot;, &quot;spacer&quot;, &quot;diff&quot;]</code></td></tr> <tr><td><code>gutters</code></td><td>Gutters to display: Available are <code>diagnostics</code> and <code>diff</code> and <code>line-numbers</code> and <code>spacer</code>, note that <code>diagnostics</code> also includes other features like breakpoints, 1-width padding will be inserted if gutters is non-empty</td><td><code>[&quot;diagnostics&quot;, &quot;spacer&quot;, &quot;line-numbers&quot;, &quot;spacer&quot;, &quot;diff&quot;]</code></td></tr>
<tr><td><code>auto-completion</code></td><td>Enable automatic pop up of auto-completion.</td><td><code>true</code></td></tr> <tr><td><code>auto-completion</code></td><td>Enable automatic pop up of auto-completion</td><td><code>true</code></td></tr>
<tr><td><code>auto-format</code></td><td>Enable automatic formatting on save.</td><td><code>true</code></td></tr> <tr><td><code>auto-format</code></td><td>Enable automatic formatting on save</td><td><code>true</code></td></tr>
<tr><td><code>auto-save</code></td><td>Enable automatic saving on focus moving away from Helix. Requires <a href="https://github.com/helix-editor/helix/wiki/Terminal-Support">focus event support</a> from your terminal.</td><td><code>false</code></td></tr> <tr><td><code>auto-save</code></td><td>Enable automatic saving on the focus moving away from Helix. Requires <a href="https://github.com/helix-editor/helix/wiki/Terminal-Support">focus event support</a> from your terminal</td><td><code>false</code></td></tr>
<tr><td><code>idle-timeout</code></td><td>Time in milliseconds since last keypress before idle timers trigger. Used for autocompletion, set to 0 for instant.</td><td><code>400</code></td></tr> <tr><td><code>idle-timeout</code></td><td>Time in milliseconds since last keypress before idle timers trigger. Used for autocompletion, set to 0 for instant</td><td><code>400</code></td></tr>
<tr><td><code>completion-trigger-len</code></td><td>The min-length of word under cursor to trigger autocompletion</td><td><code>2</code></td></tr> <tr><td><code>completion-trigger-len</code></td><td>The min-length of word under cursor to trigger autocompletion</td><td><code>2</code></td></tr>
<tr><td><code>auto-info</code></td><td>Whether to display infoboxes</td><td><code>true</code></td></tr> <tr><td><code>auto-info</code></td><td>Whether to display info boxes</td><td><code>true</code></td></tr>
<tr><td><code>true-color</code></td><td>Set to <code>true</code> to override automatic detection of terminal truecolor support in the event of a false negative.</td><td><code>false</code></td></tr> <tr><td><code>true-color</code></td><td>Set to <code>true</code> to override automatic detection of terminal truecolor support in the event of a false negative</td><td><code>false</code></td></tr>
<tr><td><code>rulers</code></td><td>List of column positions at which to display the rulers. Can be overridden by language specific <code>rulers</code> in <code>languages.toml</code> file.</td><td><code>[]</code></td></tr> <tr><td><code>rulers</code></td><td>List of column positions at which to display the rulers. Can be overridden by language specific <code>rulers</code> in <code>languages.toml</code> file</td><td><code>[]</code></td></tr>
<tr><td><code>bufferline</code></td><td>Renders a line at the top of the editor displaying open buffers. Can be <code>always</code>, <code>never</code> or <code>multiple</code> (only shown if more than one buffer is in use)</td><td><code>never</code></td></tr> <tr><td><code>bufferline</code></td><td>Renders a line at the top of the editor displaying open buffers. Can be <code>always</code>, <code>never</code> or <code>multiple</code> (only shown if more than one buffer is in use)</td><td><code>never</code></td></tr>
<tr><td><code>color-modes</code></td><td>Whether to color the mode indicator with different colors depending on the mode itself</td><td><code>false</code></td></tr> <tr><td><code>color-modes</code></td><td>Whether to color the mode indicator with different colors depending on the mode itself</td><td><code>false</code></td></tr>
</tbody></table> </tbody></table>
@ -258,9 +257,12 @@ mode.select = &quot;SELECT&quot;
<p>By default, a progress spinner is shown in the statusline beside the file path.</p> <p>By default, a progress spinner is shown in the statusline beside the file path.</p>
</div> </div>
<h3 id="editorcursor-shape-section"><a class="header" href="#editorcursor-shape-section"><code>[editor.cursor-shape]</code> Section</a></h3> <h3 id="editorcursor-shape-section"><a class="header" href="#editorcursor-shape-section"><code>[editor.cursor-shape]</code> Section</a></h3>
<p>Defines the shape of cursor in each mode. Note that due to limitations <p>Defines the shape of cursor in each mode.
of the terminal environment, only the primary cursor can change shape.
Valid values for these options are <code>block</code>, <code>bar</code>, <code>underline</code>, or <code>hidden</code>.</p> Valid values for these options are <code>block</code>, <code>bar</code>, <code>underline</code>, or <code>hidden</code>.</p>
<blockquote>
<p>💡 Due to limitations of the terminal environment, only the primary cursor can
change shape.</p>
</blockquote>
<div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Default</th></tr></thead><tbody> <div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Default</th></tr></thead><tbody>
<tr><td><code>normal</code></td><td>Cursor shape in <a href="./keymap.html#normal-mode">normal mode</a></td><td><code>block</code></td></tr> <tr><td><code>normal</code></td><td>Cursor shape in <a href="./keymap.html#normal-mode">normal mode</a></td><td><code>block</code></td></tr>
<tr><td><code>insert</code></td><td>Cursor shape in <a href="./keymap.html#insert-mode">insert mode</a></td><td><code>block</code></td></tr> <tr><td><code>insert</code></td><td>Cursor shape in <a href="./keymap.html#insert-mode">insert mode</a></td><td><code>block</code></td></tr>
@ -268,22 +270,19 @@ Valid values for these options are <code>block</code>, <code>bar</code>, <code>u
</tbody></table> </tbody></table>
</div> </div>
<h3 id="editorfile-picker-section"><a class="header" href="#editorfile-picker-section"><code>[editor.file-picker]</code> Section</a></h3> <h3 id="editorfile-picker-section"><a class="header" href="#editorfile-picker-section"><code>[editor.file-picker]</code> Section</a></h3>
<p>Sets options for file picker and global search. All but the last key listed in <p>Set options for file picker and global search. Ignoring a file means it is
the default file-picker configuration below are IgnoreOptions: whether hidden not visible in the Helix file picker and global search.</p>
files and files listed within ignore files are ignored by (not visible in) the
helix file picker and global search. There is also one other key, <code>max-depth</code>
available, which is not defined by default.</p>
<p>All git related options are only enabled in a git repository.</p> <p>All git related options are only enabled in a git repository.</p>
<div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Default</th></tr></thead><tbody> <div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Default</th></tr></thead><tbody>
<tr><td><code>hidden</code></td><td>Enables ignoring hidden files.</td><td>true</td></tr> <tr><td><code>hidden</code></td><td>Enables ignoring hidden files</td><td>true</td></tr>
<tr><td><code>follow-links</code></td><td>Follow symlinks instead of ignoring them</td><td>true</td></tr> <tr><td><code>follow-links</code></td><td>Follow symlinks instead of ignoring them</td><td>true</td></tr>
<tr><td><code>deduplicate-links</code></td><td>Ignore symlinks that point at files already shown in the picker</td><td>true</td></tr> <tr><td><code>deduplicate-links</code></td><td>Ignore symlinks that point at files already shown in the picker</td><td>true</td></tr>
<tr><td><code>parents</code></td><td>Enables reading ignore files from parent directories.</td><td>true</td></tr> <tr><td><code>parents</code></td><td>Enables reading ignore files from parent directories</td><td>true</td></tr>
<tr><td><code>ignore</code></td><td>Enables reading <code>.ignore</code> files.</td><td>true</td></tr> <tr><td><code>ignore</code></td><td>Enables reading <code>.ignore</code> files</td><td>true</td></tr>
<tr><td><code>git-ignore</code></td><td>Enables reading <code>.gitignore</code> files.</td><td>true</td></tr> <tr><td><code>git-ignore</code></td><td>Enables reading <code>.gitignore</code> files</td><td>true</td></tr>
<tr><td><code>git-global</code></td><td>Enables reading global .gitignore, whose path is specified in git's config: <code>core.excludefile</code> option.</td><td>true</td></tr> <tr><td><code>git-global</code></td><td>Enables reading global <code>.gitignore</code>, whose path is specified in git's config: <code>core.excludefile</code> option</td><td>true</td></tr>
<tr><td><code>git-exclude</code></td><td>Enables reading <code>.git/info/exclude</code> files.</td><td>true</td></tr> <tr><td><code>git-exclude</code></td><td>Enables reading <code>.git/info/exclude</code> files</td><td>true</td></tr>
<tr><td><code>max-depth</code></td><td>Set with an integer value for maximum depth to recurse.</td><td>Defaults to <code>None</code>.</td></tr> <tr><td><code>max-depth</code></td><td>Set with an integer value for maximum depth to recurse</td><td>Defaults to <code>None</code>.</td></tr>
</tbody></table> </tbody></table>
</div> </div>
<h3 id="editorauto-pairs-section"><a class="header" href="#editorauto-pairs-section"><code>[editor.auto-pairs]</code> Section</a></h3> <h3 id="editorauto-pairs-section"><a class="header" href="#editorauto-pairs-section"><code>[editor.auto-pairs]</code> Section</a></h3>
@ -321,14 +320,14 @@ name = &quot;rust&quot;
<h3 id="editorsearch-section"><a class="header" href="#editorsearch-section"><code>[editor.search]</code> Section</a></h3> <h3 id="editorsearch-section"><a class="header" href="#editorsearch-section"><code>[editor.search]</code> Section</a></h3>
<p>Search specific options.</p> <p>Search specific options.</p>
<div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Default</th></tr></thead><tbody> <div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Default</th></tr></thead><tbody>
<tr><td><code>smart-case</code></td><td>Enable smart case regex searching (case insensitive unless pattern contains upper case characters)</td><td><code>true</code></td></tr> <tr><td><code>smart-case</code></td><td>Enable smart case regex searching (case-insensitive unless pattern contains upper case characters)</td><td><code>true</code></td></tr>
<tr><td><code>wrap-around</code></td><td>Whether the search should wrap after depleting the matches</td><td><code>true</code></td></tr> <tr><td><code>wrap-around</code></td><td>Whether the search should wrap after depleting the matches</td><td><code>true</code></td></tr>
</tbody></table> </tbody></table>
</div> </div>
<h3 id="editorwhitespace-section"><a class="header" href="#editorwhitespace-section"><code>[editor.whitespace]</code> Section</a></h3> <h3 id="editorwhitespace-section"><a class="header" href="#editorwhitespace-section"><code>[editor.whitespace]</code> Section</a></h3>
<p>Options for rendering whitespace with visible characters. Use <code>:set whitespace.render all</code> to temporarily enable visible whitespace.</p> <p>Options for rendering whitespace with visible characters. Use <code>:set whitespace.render all</code> to temporarily enable visible whitespace.</p>
<div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Default</th></tr></thead><tbody> <div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Default</th></tr></thead><tbody>
<tr><td><code>render</code></td><td>Whether to render whitespace. May either be <code>&quot;all&quot;</code> or <code>&quot;none&quot;</code>, or a table with sub-keys <code>space</code>, <code>nbsp</code>, <code>tab</code>, and <code>newline</code>.</td><td><code>&quot;none&quot;</code></td></tr> <tr><td><code>render</code></td><td>Whether to render whitespace. May either be <code>&quot;all&quot;</code> or <code>&quot;none&quot;</code>, or a table with sub-keys <code>space</code>, <code>nbsp</code>, <code>tab</code>, and <code>newline</code></td><td><code>&quot;none&quot;</code></td></tr>
<tr><td><code>characters</code></td><td>Literal characters to use when rendering whitespace. Sub-keys may be any of <code>tab</code>, <code>space</code>, <code>nbsp</code>, <code>newline</code> or <code>tabpad</code></td><td>See example below</td></tr> <tr><td><code>characters</code></td><td>Literal characters to use when rendering whitespace. Sub-keys may be any of <code>tab</code>, <code>space</code>, <code>nbsp</code>, <code>newline</code> or <code>tabpad</code></td><td>See example below</td></tr>
</tbody></table> </tbody></table>
</div> </div>
@ -351,7 +350,7 @@ tabpad = &quot;·&quot; # Tabs will look like &quot;→···&quot; (depending o
<h3 id="editorindent-guides-section"><a class="header" href="#editorindent-guides-section"><code>[editor.indent-guides]</code> Section</a></h3> <h3 id="editorindent-guides-section"><a class="header" href="#editorindent-guides-section"><code>[editor.indent-guides]</code> Section</a></h3>
<p>Options for rendering vertical indent guides.</p> <p>Options for rendering vertical indent guides.</p>
<div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Default</th></tr></thead><tbody> <div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Default</th></tr></thead><tbody>
<tr><td><code>render</code></td><td>Whether to render indent guides.</td><td><code>false</code></td></tr> <tr><td><code>render</code></td><td>Whether to render indent guides</td><td><code>false</code></td></tr>
<tr><td><code>character</code></td><td>Literal character to use for rendering the indent guide</td><td><code></code></td></tr> <tr><td><code>character</code></td><td>Literal character to use for rendering the indent guide</td><td><code></code></td></tr>
<tr><td><code>skip-levels</code></td><td>Number of indent levels to skip</td><td><code>0</code></td></tr> <tr><td><code>skip-levels</code></td><td>Number of indent levels to skip</td><td><code>0</code></td></tr>
</tbody></table> </tbody></table>
@ -370,7 +369,7 @@ gutters = [&quot;diff&quot;, &quot;diagnostics&quot;, &quot;line-numbers&quot;,
</code></pre> </code></pre>
<p>To customize the behavior of gutters, the <code>[editor.gutters]</code> section must <p>To customize the behavior of gutters, the <code>[editor.gutters]</code> section must
be used. This section contains top level settings, as well as settings for be used. This section contains top level settings, as well as settings for
specific gutter components as sub-sections.</p> specific gutter components as subsections.</p>
<div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Default</th></tr></thead><tbody> <div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Default</th></tr></thead><tbody>
<tr><td><code>layout</code></td><td>A vector of gutters to display</td><td><code>[&quot;diagnostics&quot;, &quot;spacer&quot;, &quot;line-numbers&quot;, &quot;spacer&quot;, &quot;diff&quot;]</code></td></tr> <tr><td><code>layout</code></td><td>A vector of gutters to display</td><td><code>[&quot;diagnostics&quot;, &quot;spacer&quot;, &quot;line-numbers&quot;, &quot;spacer&quot;, &quot;diff&quot;]</code></td></tr>
</tbody></table> </tbody></table>
@ -396,11 +395,11 @@ min-width = 1
<h4 id="editorguttersspacer-section"><a class="header" href="#editorguttersspacer-section"><code>[editor.gutters.spacer]</code> Section</a></h4> <h4 id="editorguttersspacer-section"><a class="header" href="#editorguttersspacer-section"><code>[editor.gutters.spacer]</code> Section</a></h4>
<p>Currently unused</p> <p>Currently unused</p>
<h3 id="editorsoft-wrap-section"><a class="header" href="#editorsoft-wrap-section"><code>[editor.soft-wrap]</code> Section</a></h3> <h3 id="editorsoft-wrap-section"><a class="header" href="#editorsoft-wrap-section"><code>[editor.soft-wrap]</code> Section</a></h3>
<p>Options for soft wrapping lines that exceed the view width</p> <p>Options for soft wrapping lines that exceed the view width:</p>
<div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Default</th></tr></thead><tbody> <div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Default</th></tr></thead><tbody>
<tr><td><code>enable</code></td><td>Whether soft wrapping is enabled.</td><td><code>false</code></td></tr> <tr><td><code>enable</code></td><td>Whether soft wrapping is enabled</td><td><code>false</code></td></tr>
<tr><td><code>max-wrap</code></td><td>Maximum free space left at the end of the line.</td><td><code>20</code></td></tr> <tr><td><code>max-wrap</code></td><td>Maximum free space left at the end of the line</td><td><code>20</code></td></tr>
<tr><td><code>max-indent-retain</code></td><td>Maximum indentation to carry over when soft wrapping a line.</td><td><code>40</code></td></tr> <tr><td><code>max-indent-retain</code></td><td>Maximum indentation to carry over when soft wrapping a line</td><td><code>40</code></td></tr>
<tr><td><code>wrap-indicator</code></td><td>Text inserted before soft wrapped lines, highlighted with <code>ui.virtual.wrap</code></td><td><code></code></td></tr> <tr><td><code>wrap-indicator</code></td><td>Text inserted before soft wrapped lines, highlighted with <code>ui.virtual.wrap</code></td><td><code></code></td></tr>
</tbody></table> </tbody></table>
</div> </div>

@ -83,7 +83,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents"> <nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox"> <div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html"><strong aria-hidden="true">2.3.</strong> Language Support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html" class="active"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html"><strong aria-hidden="true">4.2.</strong> Key Remapping</a></li><li class="chapter-item expanded "><a href="languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding Languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding Textobject Queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding Indent Queries</a></li></ol></li></ol> <ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html"><strong aria-hidden="true">2.3.</strong> Language support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html" class="active"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html"><strong aria-hidden="true">4.2.</strong> Key remapping</a></li><li class="chapter-item expanded "><a href="languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding textobject queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding indent queries</a></li></ol></li></ol>
</div> </div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
</nav> </nav>

@ -3,7 +3,7 @@
<head> <head>
<!-- Book generated using mdBook --> <!-- Book generated using mdBook -->
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Adding Languages</title> <title>Adding languages</title>
<!-- Custom HTML head --> <!-- Custom HTML head -->
@ -83,7 +83,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents"> <nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox"> <div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded affix "><a href="../title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="../install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="../usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="../commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="../lang-support.html"><strong aria-hidden="true">2.3.</strong> Language Support</a></li></ol></li><li class="chapter-item expanded "><a href="../from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="../configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="../remapping.html"><strong aria-hidden="true">4.2.</strong> Key Remapping</a></li><li class="chapter-item expanded "><a href="../languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="../guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../guides/adding_languages.html" class="active"><strong aria-hidden="true">5.1.</strong> Adding Languages</a></li><li class="chapter-item expanded "><a href="../guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding Textobject Queries</a></li><li class="chapter-item expanded "><a href="../guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding Indent Queries</a></li></ol></li></ol> <ol class="chapter"><li class="chapter-item expanded affix "><a href="../title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="../install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="../usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="../commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="../lang-support.html"><strong aria-hidden="true">2.3.</strong> Language support</a></li></ol></li><li class="chapter-item expanded "><a href="../from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="../configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="../remapping.html"><strong aria-hidden="true">4.2.</strong> Key remapping</a></li><li class="chapter-item expanded "><a href="../languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="../guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../guides/adding_languages.html" class="active"><strong aria-hidden="true">5.1.</strong> Adding languages</a></li><li class="chapter-item expanded "><a href="../guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding textobject queries</a></li><li class="chapter-item expanded "><a href="../guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding indent queries</a></li></ol></li></ol>
</div> </div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
</nav> </nav>
@ -147,41 +147,58 @@
<div id="content" class="content"> <div id="content" class="content">
<main> <main>
<h1 id="adding-languages"><a class="header" href="#adding-languages">Adding languages</a></h1> <h1 id="adding-new-languages-to-helix"><a class="header" href="#adding-new-languages-to-helix">Adding new languages to Helix</a></h1>
<p>In order to add a new language to Helix, you will need to follow the steps
below.</p>
<h2 id="language-configuration"><a class="header" href="#language-configuration">Language configuration</a></h2> <h2 id="language-configuration"><a class="header" href="#language-configuration">Language configuration</a></h2>
<p>To add a new language, you need to add a <code>[[language]]</code> entry to the <ol>
<code>languages.toml</code> (see the <a href="../languages.html">language configuration section</a>).</p> <li>Add a new <code>[[language]]</code> entry in the <code>languages.toml</code> file and provide the
<p>When adding a new language or Language Server configuration for an existing necessary configuration for the new language. For more information on
language, run <code>cargo xtask docgen</code> to add the new configuration to the language configuration, refer to the
<a href="../lang-support.html">Language Support</a> docs before creating a pull request. <a href="../languages.html">language configuration section</a> of the documentation.</li>
When adding a Language Server configuration, be sure to update the <li>If you are adding a new language or updating an existing language server
<a href="https://github.com/helix-editor/helix/wiki/How-to-install-the-default-language-servers">Language Server Wiki</a> with installation notes.</p> configuration, run the command <code>cargo xtask docgen</code> to update the
<a href="../lang-support.html">Language Support</a> documentation.</li>
</ol>
<blockquote>
<p>💡 If you are adding a new Language Server configuration, make sure to update
the
<a href="https://github.com/helix-editor/helix/wiki/How-to-install-the-default-language-servers">Language Server Wiki</a>
with the installation instructions.</p>
</blockquote>
<h2 id="grammar-configuration"><a class="header" href="#grammar-configuration">Grammar configuration</a></h2> <h2 id="grammar-configuration"><a class="header" href="#grammar-configuration">Grammar configuration</a></h2>
<p>If a tree-sitter grammar is available for the language, add a new <code>[[grammar]]</code> <ol>
entry to <code>languages.toml</code>.</p> <li>If a tree-sitter grammar is available for the new language, add a new
<p>You may use the <code>source.path</code> key rather than <code>source.git</code> with an absolute path <code>[[grammar]]</code> entry to the <code>languages.toml</code> file.</li>
to a locally available grammar for testing, but switch to <code>source.git</code> before <li>If you are testing the grammar locally, you can use the <code>source.path</code> key
submitting a pull request.</p> with an absolute path to the grammar. However, before submitting a pull
request, make sure to switch to using <code>source.git</code>.</li>
</ol>
<h2 id="queries"><a class="header" href="#queries">Queries</a></h2> <h2 id="queries"><a class="header" href="#queries">Queries</a></h2>
<p>For a language to have syntax-highlighting and indentation among <ol>
other things, you have to add queries. Add a directory for your <li>In order to provide syntax highlighting and indentation for the new language,
language with the path <code>runtime/queries/&lt;name&gt;/</code>. The tree-sitter you will need to add queries.</li>
<a href="https://tree-sitter.github.io/tree-sitter/syntax-highlighting#queries">website</a> <li>Create a new directory for the language with the path
gives more info on how to write queries.</p> <code>runtime/queries/&lt;name&gt;/</code>.</li>
<li>Refer to the
<a href="https://tree-sitter.github.io/tree-sitter/syntax-highlighting#queries">tree-sitter website</a>
for more information on writing queries.</li>
</ol>
<blockquote> <blockquote>
<p>NOTE: When evaluating queries, the first matching query takes <p>💡 In Helix, the first matching query takes precedence when evaluating
precedence, which is different from other editors like Neovim where queries, which is different from other editors such as Neovim where the last
the last matching query supersedes the ones before it. See matching query supersedes the ones before it. See
<a href="https://github.com/helix-editor/helix/pull/1170#issuecomment-997294090">this issue</a> for an example.</p> <a href="https://github.com/helix-editor/helix/pull/1170#issuecomment-997294090">this issue</a>
for an example.</p>
</blockquote> </blockquote>
<h2 id="common-issues"><a class="header" href="#common-issues">Common Issues</a></h2> <h2 id="common-issues"><a class="header" href="#common-issues">Common issues</a></h2>
<ul> <ul>
<li> <li>If you encounter errors when running Helix after switching branches, you may
<p>If you get errors when running after switching branches, you may have to update the tree-sitter grammars. Run <code>hx --grammar fetch</code> to fetch the grammars and <code>hx --grammar build</code> to build any out-of-date grammars.</p> need to update the tree-sitter grammars. Run the command <code>hx --grammar fetch</code>
</li> to fetch the grammars and <code>hx --grammar build</code> to build any out-of-date
<li> grammars.</li>
<p>If a parser is segfaulting or you want to remove the parser, make sure to remove the compiled parser in <code>runtime/grammar/&lt;name&gt;.so</code></p> <li>If a parser is causing a segfault, or you want to remove it, make sure to
</li> remove the compiled parser located at <code>runtime/grammars/&lt;name&gt;.so</code>.</li>
</ul> </ul>
</main> </main>

@ -3,7 +3,7 @@
<head> <head>
<!-- Book generated using mdBook --> <!-- Book generated using mdBook -->
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Adding Indent Queries</title> <title>Adding indent queries</title>
<!-- Custom HTML head --> <!-- Custom HTML head -->
@ -83,7 +83,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents"> <nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox"> <div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded affix "><a href="../title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="../install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="../usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="../commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="../lang-support.html"><strong aria-hidden="true">2.3.</strong> Language Support</a></li></ol></li><li class="chapter-item expanded "><a href="../from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="../configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="../remapping.html"><strong aria-hidden="true">4.2.</strong> Key Remapping</a></li><li class="chapter-item expanded "><a href="../languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="../guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding Languages</a></li><li class="chapter-item expanded "><a href="../guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding Textobject Queries</a></li><li class="chapter-item expanded "><a href="../guides/indent.html" class="active"><strong aria-hidden="true">5.3.</strong> Adding Indent Queries</a></li></ol></li></ol> <ol class="chapter"><li class="chapter-item expanded affix "><a href="../title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="../install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="../usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="../commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="../lang-support.html"><strong aria-hidden="true">2.3.</strong> Language support</a></li></ol></li><li class="chapter-item expanded "><a href="../from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="../configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="../remapping.html"><strong aria-hidden="true">4.2.</strong> Key remapping</a></li><li class="chapter-item expanded "><a href="../languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="../guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding languages</a></li><li class="chapter-item expanded "><a href="../guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding textobject queries</a></li><li class="chapter-item expanded "><a href="../guides/indent.html" class="active"><strong aria-hidden="true">5.3.</strong> Adding indent queries</a></li></ol></li></ol>
</div> </div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
</nav> </nav>
@ -147,7 +147,7 @@
<div id="content" class="content"> <div id="content" class="content">
<main> <main>
<h1 id="adding-indent-queries"><a class="header" href="#adding-indent-queries">Adding Indent Queries</a></h1> <h1 id="adding-indent-queries"><a class="header" href="#adding-indent-queries">Adding indent queries</a></h1>
<p>Helix uses tree-sitter to correctly indent new lines. This requires <p>Helix uses tree-sitter to correctly indent new lines. This requires
a tree-sitter grammar and an <code>indent.scm</code> query file placed in a tree-sitter grammar and an <code>indent.scm</code> query file placed in
<code>runtime/queries/{language}/indents.scm</code>. The indentation for a line <code>runtime/queries/{language}/indents.scm</code>. The indentation for a line
@ -182,7 +182,7 @@ changed by using a <code>#set!</code> declaration anywhere in the pattern:</p>
right: (_) @indent right: (_) @indent
(#set! &quot;scope&quot; &quot;all&quot;)) (#set! &quot;scope&quot; &quot;all&quot;))
</code></pre> </code></pre>
<h2 id="capture-types"><a class="header" href="#capture-types">Capture Types</a></h2> <h2 id="capture-types"><a class="header" href="#capture-types">Capture types</a></h2>
<ul> <ul>
<li> <li>
<p><code>@indent</code> (default scope <code>tail</code>): <p><code>@indent</code> (default scope <code>tail</code>):

@ -83,7 +83,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents"> <nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox"> <div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded affix "><a href="../title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="../install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="../usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="../commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="../lang-support.html"><strong aria-hidden="true">2.3.</strong> Language Support</a></li></ol></li><li class="chapter-item expanded "><a href="../from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="../configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="../remapping.html"><strong aria-hidden="true">4.2.</strong> Key Remapping</a></li><li class="chapter-item expanded "><a href="../languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="../guides/index.html" class="active"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding Languages</a></li><li class="chapter-item expanded "><a href="../guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding Textobject Queries</a></li><li class="chapter-item expanded "><a href="../guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding Indent Queries</a></li></ol></li></ol> <ol class="chapter"><li class="chapter-item expanded affix "><a href="../title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="../install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="../usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="../commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="../lang-support.html"><strong aria-hidden="true">2.3.</strong> Language support</a></li></ol></li><li class="chapter-item expanded "><a href="../from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="../configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="../remapping.html"><strong aria-hidden="true">4.2.</strong> Key remapping</a></li><li class="chapter-item expanded "><a href="../languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="../guides/index.html" class="active"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding languages</a></li><li class="chapter-item expanded "><a href="../guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding textobject queries</a></li><li class="chapter-item expanded "><a href="../guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding indent queries</a></li></ol></li></ol>
</div> </div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
</nav> </nav>
@ -149,7 +149,7 @@
<main> <main>
<h1 id="guides"><a class="header" href="#guides">Guides</a></h1> <h1 id="guides"><a class="header" href="#guides">Guides</a></h1>
<p>This section contains guides for adding new language server configurations, <p>This section contains guides for adding new language server configurations,
tree-sitter grammars, textobject queries, etc.</p> tree-sitter grammars, textobject queries, and other similar items.</p>
</main> </main>

@ -3,7 +3,7 @@
<head> <head>
<!-- Book generated using mdBook --> <!-- Book generated using mdBook -->
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Adding Textobject Queries</title> <title>Adding textobject queries</title>
<!-- Custom HTML head --> <!-- Custom HTML head -->
@ -83,7 +83,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents"> <nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox"> <div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded affix "><a href="../title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="../install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="../usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="../commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="../lang-support.html"><strong aria-hidden="true">2.3.</strong> Language Support</a></li></ol></li><li class="chapter-item expanded "><a href="../from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="../configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="../remapping.html"><strong aria-hidden="true">4.2.</strong> Key Remapping</a></li><li class="chapter-item expanded "><a href="../languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="../guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding Languages</a></li><li class="chapter-item expanded "><a href="../guides/textobject.html" class="active"><strong aria-hidden="true">5.2.</strong> Adding Textobject Queries</a></li><li class="chapter-item expanded "><a href="../guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding Indent Queries</a></li></ol></li></ol> <ol class="chapter"><li class="chapter-item expanded affix "><a href="../title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="../install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="../usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="../commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="../lang-support.html"><strong aria-hidden="true">2.3.</strong> Language support</a></li></ol></li><li class="chapter-item expanded "><a href="../from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="../configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="../remapping.html"><strong aria-hidden="true">4.2.</strong> Key remapping</a></li><li class="chapter-item expanded "><a href="../languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="../guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding languages</a></li><li class="chapter-item expanded "><a href="../guides/textobject.html" class="active"><strong aria-hidden="true">5.2.</strong> Adding textobject queries</a></li><li class="chapter-item expanded "><a href="../guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding indent queries</a></li></ol></li></ol>
</div> </div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
</nav> </nav>
@ -147,15 +147,15 @@
<div id="content" class="content"> <div id="content" class="content">
<main> <main>
<h1 id="adding-textobject-queries"><a class="header" href="#adding-textobject-queries">Adding Textobject Queries</a></h1> <h1 id="adding-textobject-queries"><a class="header" href="#adding-textobject-queries">Adding textobject queries</a></h1>
<p>Textobjects that are language specific (<a href="../usage.html#textobjects">like functions, classes, etc</a>) <p>Helix supports textobjects that are language specific, such as functions, classes, etc.
require an accompanying tree-sitter grammar and a <code>textobjects.scm</code> query file These textobjects require an accompanying tree-sitter grammar and a <code>textobjects.scm</code> query file
to work properly. Tree-sitter allows us to query the source code syntax tree to work properly. Tree-sitter allows us to query the source code syntax tree
and capture specific parts of it. The queries are written in a lisp dialect. and capture specific parts of it. The queries are written in a lisp dialect.
More information on how to write queries can be found in the <a href="https://tree-sitter.github.io/tree-sitter/using-parsers#query-syntax">official tree-sitter More information on how to write queries can be found in the <a href="https://tree-sitter.github.io/tree-sitter/using-parsers#query-syntax">official tree-sitter
documentation</a>.</p> documentation</a>.</p>
<p>Query files should be placed in <code>runtime/queries/{language}/textobjects.scm</code> <p>Query files should be placed in <code>runtime/queries/{language}/textobjects.scm</code>
when contributing. Note that to test the query files locally you should put when contributing to Helix. Note that to test the query files locally you should put
them under your local runtime directory (<code>~/.config/helix/runtime</code> on Linux them under your local runtime directory (<code>~/.config/helix/runtime</code> on Linux
for example).</p> for example).</p>
<p>The following <a href="https://tree-sitter.github.io/tree-sitter/using-parsers#capturing-nodes">captures</a> are recognized:</p> <p>The following <a href="https://tree-sitter.github.io/tree-sitter/using-parsers#capturing-nodes">captures</a> are recognized:</p>
@ -172,8 +172,8 @@ for example).</p>
</tbody></table> </tbody></table>
</div> </div>
<p><a href="https://github.com/search?q=repo%3Ahelix-editor%2Fhelix+filename%3Atextobjects.scm&amp;type=Code&amp;ref=advsearch&amp;l=&amp;l=">Example query files</a> can be found in the helix GitHub repository.</p> <p><a href="https://github.com/search?q=repo%3Ahelix-editor%2Fhelix+filename%3Atextobjects.scm&amp;type=Code&amp;ref=advsearch&amp;l=&amp;l=">Example query files</a> can be found in the helix GitHub repository.</p>
<h2 id="queries-for-textobject-based-navigation"><a class="header" href="#queries-for-textobject-based-navigation">Queries for Textobject Based Navigation</a></h2> <h2 id="queries-for-textobject-based-navigation"><a class="header" href="#queries-for-textobject-based-navigation">Queries for textobject based navigation</a></h2>
<p><a href="../usage.html#tree-sitter-textobject-based-navigation">Tree-sitter based navigation</a> is done using captures in the <p>Tree-sitter based navigation in Helix is done using captures in the
following order:</p> following order:</p>
<ul> <ul>
<li><code>object.movement</code></li> <li><code>object.movement</code></li>
@ -181,7 +181,7 @@ following order:</p>
<li><code>object.inside</code></li> <li><code>object.inside</code></li>
</ul> </ul>
<p>For example if a <code>function.around</code> capture has been already defined for a language <p>For example if a <code>function.around</code> capture has been already defined for a language
in it's <code>textobjects.scm</code> file, function navigation should also work automatically. in its <code>textobjects.scm</code> file, function navigation should also work automatically.
<code>function.movement</code> should be defined only if the node captured by <code>function.around</code> <code>function.movement</code> should be defined only if the node captured by <code>function.around</code>
doesn't make sense in a navigation context.</p> doesn't make sense in a navigation context.</p>

@ -83,7 +83,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents"> <nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox"> <div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html" class="active">Helix</a></li><li class="chapter-item expanded "><a href="install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html"><strong aria-hidden="true">2.3.</strong> Language Support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html"><strong aria-hidden="true">4.2.</strong> Key Remapping</a></li><li class="chapter-item expanded "><a href="languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding Languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding Textobject Queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding Indent Queries</a></li></ol></li></ol> <ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html" class="active">Helix</a></li><li class="chapter-item expanded "><a href="install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html"><strong aria-hidden="true">2.3.</strong> Language support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html"><strong aria-hidden="true">4.2.</strong> Key remapping</a></li><li class="chapter-item expanded "><a href="languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding textobject queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding indent queries</a></li></ol></li></ol>
</div> </div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
</nav> </nav>

@ -83,7 +83,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents"> <nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox"> <div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="install.html" class="active"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html"><strong aria-hidden="true">2.3.</strong> Language Support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html"><strong aria-hidden="true">4.2.</strong> Key Remapping</a></li><li class="chapter-item expanded "><a href="languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding Languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding Textobject Queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding Indent Queries</a></li></ol></li></ol> <ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="install.html" class="active"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html"><strong aria-hidden="true">2.3.</strong> Language support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html"><strong aria-hidden="true">4.2.</strong> Key remapping</a></li><li class="chapter-item expanded "><a href="languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding textobject queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding indent queries</a></li></ol></li></ol>
</div> </div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
</nav> </nav>
@ -147,119 +147,179 @@
<div id="content" class="content"> <div id="content" class="content">
<main> <main>
<h1 id="installation"><a class="header" href="#installation">Installation</a></h1> <h1 id="installing-helix"><a class="header" href="#installing-helix">Installing Helix</a></h1>
<p>We provide pre-built binaries on the <a href="https://github.com/helix-editor/helix/releases">GitHub Releases page</a>.</p> <!--toc:start-->
<ul>
<li><a href="#pre-built-binaries">Pre-built binaries</a></li>
<li><a href="#linux-macos-windows-and-openbsd-packaging-status">Linux, macOS, Windows and OpenBSD packaging status</a></li>
<li><a href="#linux">Linux</a>
<ul>
<li><a href="#ubuntu">Ubuntu</a></li>
<li><a href="#fedorarhel">Fedora/RHEL</a></li>
<li><a href="#arch-linux-community">Arch Linux community</a></li>
<li><a href="#nixos">NixOS</a></li>
</ul>
</li>
<li><a href="#macos">macOS</a>
<ul>
<li><a href="#homebrew-core">Homebrew Core</a></li>
</ul>
</li>
<li><a href="#windows">Windows</a>
<ul>
<li><a href="#scoop">Scoop</a></li>
<li><a href="#chocolatey">Chocolatey</a></li>
<li><a href="#msys2">MSYS2</a></li>
</ul>
</li>
<li><a href="#building-from-source">Building from source</a>
<ul>
<li><a href="#configuring-helixs-runtime-files">Configuring Helix's runtime files</a></li>
<li><a href="#validating-the-installation">Validating the installation</a></li>
<li><a href="#configure-the-desktop-shortcut">Configure the desktop shortcut</a></li>
</ul>
</li>
</ul>
<!--toc:end-->
<p>To install Helix, follow the instructions specific to your operating system.
Note that:</p>
<ul>
<li>
<p>To get the latest nightly version of Helix, you need to
<a href="#building-from-source">build from source</a>.</p>
</li>
<li>
<p>To take full advantage of Helix, install the language servers for your
preferred programming languages. See the
<a href="https://github.com/helix-editor/helix/wiki/How-to-install-the-default-language-servers">wiki</a>
for instructions.</p>
</li>
</ul>
<h2 id="pre-built-binaries"><a class="header" href="#pre-built-binaries">Pre-built binaries</a></h2>
<p>Download pre-built binaries from the
<a href="https://github.com/helix-editor/helix/releases">GitHub Releases page</a>. Add the binary to your system's <code>$PATH</code> to use it from the command
line.</p>
<h2 id="linux-macos-windows-and-openbsd-packaging-status"><a class="header" href="#linux-macos-windows-and-openbsd-packaging-status">Linux, macOS, Windows and OpenBSD packaging status</a></h2>
<p>Helix is available for Linux, macOS and Windows via the official repositories listed below.</p>
<p><a href="https://repology.org/project/helix/versions"><img src="https://repology.org/badge/vertical-allrepos/helix.svg" alt="Packaging status" /></a></p> <p><a href="https://repology.org/project/helix/versions"><img src="https://repology.org/badge/vertical-allrepos/helix.svg" alt="Packaging status" /></a></p>
<h2 id="osx"><a class="header" href="#osx">OSX</a></h2>
<p>Helix is available in homebrew-core:</p>
<pre><code>brew install helix
</code></pre>
<h2 id="linux"><a class="header" href="#linux">Linux</a></h2> <h2 id="linux"><a class="header" href="#linux">Linux</a></h2>
<h3 id="nixos"><a class="header" href="#nixos">NixOS</a></h3> <p>The following third party repositories are available:</p>
<p>A <a href="https://nixos.wiki/wiki/Flakes">flake</a> containing the package is available in <h3 id="ubuntu"><a class="header" href="#ubuntu">Ubuntu</a></h3>
the project root. The flake can also be used to spin up a reproducible development <p>Helix is available via <a href="https://launchpad.net/~maveonair/+archive/ubuntu/helix-editor">Maveonair's PPA</a>:</p>
shell for working on Helix with <code>nix develop</code>.</p> <pre><code class="language-sh">sudo add-apt-repository ppa:maveonair/helix-editor
<p>Flake outputs are cached for each push to master using sudo apt update
<a href="https://www.cachix.org/">Cachix</a>. The flake is configured to sudo apt install helix
automatically make use of this cache assuming the user accepts </code></pre>
the new settings on first use.</p> <h3 id="fedorarhel"><a class="header" href="#fedorarhel">Fedora/RHEL</a></h3>
<p>If you are using a version of Nix without flakes enabled you can <p>Helix is available via <code>copr</code>:</p>
<a href="https://docs.cachix.org/installation">install Cachix cli</a>; <code>cachix use helix</code> will <pre><code class="language-sh">sudo dnf copr enable varlad/helix
configure Nix to use cached outputs when possible.</p>
<h3 id="arch-linux"><a class="header" href="#arch-linux">Arch Linux</a></h3>
<p>Releases are available in the <code>community</code> repository.</p>
<p>A <a href="https://aur.archlinux.org/packages/helix-git/">helix-git</a> package is also available on the AUR, which builds the master branch.</p>
<h3 id="fedora-linux"><a class="header" href="#fedora-linux">Fedora Linux</a></h3>
<p>You can install the COPR package for Helix via</p>
<pre><code>sudo dnf copr enable varlad/helix
sudo dnf install helix sudo dnf install helix
</code></pre> </code></pre>
<h3 id="void-linux"><a class="header" href="#void-linux">Void Linux</a></h3> <h3 id="arch-linux-community"><a class="header" href="#arch-linux-community">Arch Linux community</a></h3>
<pre><code>sudo xbps-install helix <p>Releases are available in the <code>community</code> repository:</p>
<pre><code class="language-sh">sudo pacman -S helix
</code></pre>
<p>Additionally, a <a href="https://aur.archlinux.org/packages/helix-git/">helix-git</a> package is available
in the AUR, which builds the master branch.</p>
<h3 id="nixos"><a class="header" href="#nixos">NixOS</a></h3>
<p>Helix is available as a <a href="https://nixos.wiki/wiki/Flakes">flake</a> in the project
root. Use <code>nix develop</code> to spin up a reproducible development shell. Outputs are
cached for each push to master using <a href="https://www.cachix.org/">Cachix</a>. The
flake is configured to automatically make use of this cache assuming the user
accepts the new settings on first use.</p>
<p>If you are using a version of Nix without flakes enabled,
<a href="https://docs.cachix.org/installation">install Cachix CLI</a> and use
<code>cachix use helix</code> to configure Nix to use cached outputs when possible.</p>
<h2 id="macos"><a class="header" href="#macos">macOS</a></h2>
<h3 id="homebrew-core"><a class="header" href="#homebrew-core">Homebrew Core</a></h3>
<pre><code class="language-sh">brew install helix
</code></pre> </code></pre>
<h2 id="windows"><a class="header" href="#windows">Windows</a></h2> <h2 id="windows"><a class="header" href="#windows">Windows</a></h2>
<p>Helix can be installed using <a href="https://scoop.sh/">Scoop</a>, <a href="https://chocolatey.org/">Chocolatey</a> <p>Install on Windows using <a href="https://scoop.sh/">Scoop</a>, <a href="https://chocolatey.org/">Chocolatey</a>
or <a href="https://msys2.org/">MSYS2</a>.</p> or <a href="https://msys2.org/">MSYS2</a>.</p>
<p><strong>Scoop:</strong></p> <h3 id="scoop"><a class="header" href="#scoop">Scoop</a></h3>
<pre><code>scoop install helix <pre><code class="language-sh">scoop install helix
</code></pre> </code></pre>
<p><strong>Chocolatey:</strong></p> <h3 id="chocolatey"><a class="header" href="#chocolatey">Chocolatey</a></h3>
<pre><code>choco install helix <pre><code class="language-sh">choco install helix
</code></pre> </code></pre>
<p><strong>MSYS2:</strong></p> <h3 id="msys2"><a class="header" href="#msys2">MSYS2</a></h3>
<p>Choose the <a href="https://www.msys2.org/docs/package-naming/">proper command</a> for your system from below:</p> <p>For 64-bit Windows 8.1 or above:</p>
<ul> <pre><code class="language-sh">pacman -S mingw-w64-ucrt-x86_64-helix
<li>For 32 bit Windows 7 or above:</li>
</ul>
<pre><code>pacman -S mingw-w64-i686-helix
</code></pre> </code></pre>
<ul> <h2 id="building-from-source"><a class="header" href="#building-from-source">Building from source</a></h2>
<li>For 64 bit Windows 7 or above:</li> <p>Clone the repository:</p>
</ul> <pre><code class="language-sh">git clone https://github.com/helix-editor/helix
<pre><code>pacman -S mingw-w64-x86_64-helix cd helix
</code></pre> </code></pre>
<ul> <p>Compile from source:</p>
<li>For 64 bit Windows 8.1 or above:</li> <pre><code class="language-sh">cargo install --path helix-term --locked
</ul>
<pre><code>pacman -S mingw-w64-ucrt-x86_64-helix
</code></pre> </code></pre>
<h2 id="build-from-source"><a class="header" href="#build-from-source">Build from source</a></h2> <p>This command will create the <code>hx</code> executable and construct the tree-sitter
<pre><code>git clone https://github.com/helix-editor/helix grammars either in the <code>runtime</code> folder, or in the folder specified in <code>HELIX_RUNTIME</code>
cd helix (as described below). To build the tree-sitter grammars requires a c++ compiler to be installed, for example <code>gcc-c++</code>.</p>
cargo install --path helix-term --locked <blockquote>
<p>💡 If you are using the musl-libc instead of glibc the following environment variable must be set during the build
to ensure tree-sitter grammars can be loaded correctly:</p>
<pre><code class="language-sh">RUSTFLAGS=&quot;-C target-feature=-crt-static&quot;
</code></pre> </code></pre>
<p>This will install the <code>hx</code> binary to <code>$HOME/.cargo/bin</code> and build tree-sitter grammars in <code>./runtime/grammars</code>.</p> </blockquote>
<p>If you are using the musl-libc instead of glibc the following environment variable must be set during the build <blockquote>
to ensure tree sitter grammars can be loaded correctly:</p> <p>💡 Tree-sitter grammars can be fetched and compiled if not pre-packaged. Fetch
<pre><code>RUSTFLAGS=&quot;-C target-feature=-crt-static&quot; grammars with <code>hx --grammar fetch</code> (requires <code>git</code>) and compile them with
<code>hx --grammar build</code> (requires a C++ compiler).</p>
</blockquote>
<h3 id="configuring-helixs-runtime-files"><a class="header" href="#configuring-helixs-runtime-files">Configuring Helix's runtime files</a></h3>
<ul>
<li><strong>Linux and macOS</strong></li>
</ul>
<p>Either set the <code>HELIX_RUNTIME</code> environment variable to point to the runtime files and add it to your <code>~/.bashrc</code> or equivalent:</p>
<pre><code class="language-sh">HELIX_RUNTIME=/home/user-name/src/helix/runtime
</code></pre> </code></pre>
<p>Helix also needs its runtime files so make sure to copy/symlink the <code>runtime/</code> directory into the <p>Or, create a symlink in <code>~/.config/helix</code> that links to the source code directory:</p>
config directory (for example <code>~/.config/helix/runtime</code> on Linux/macOS). This location can be overridden <pre><code class="language-sh">ln -s $PWD/runtime ~/.config/helix/runtime
via the <code>HELIX_RUNTIME</code> environment variable.</p>
<div class="table-wrapper"><table><thead><tr><th>OS</th><th>Command</th></tr></thead><tbody>
<tr><td>Windows (Cmd)</td><td><code>xcopy /e /i runtime %AppData%\helix\runtime</code></td></tr>
<tr><td>Windows (PowerShell)</td><td><code>xcopy /e /i runtime $Env:AppData\helix\runtime</code></td></tr>
<tr><td>Linux / macOS</td><td><code>ln -s $PWD/runtime ~/.config/helix/runtime</code></td></tr>
</tbody></table>
</div>
<p>Starting with Windows Vista you can also create symbolic links on Windows. Note that this requires
elevated privileges - i.e. PowerShell or Cmd must be run as administrator.</p>
<p><strong>PowerShell:</strong></p>
<pre><code class="language-powershell">New-Item -ItemType Junction -Target &quot;runtime&quot; -Path &quot;$Env:AppData\helix\runtime&quot;
</code></pre> </code></pre>
<p>Note: &quot;runtime&quot; must be the absolute path to the runtime directory.</p> <ul>
<p><strong>Cmd:</strong></p> <li><strong>Windows</strong></li>
<pre><code class="language-cmd">cd %appdata%\helix </ul>
mklink /D runtime &quot;&lt;helix-repo&gt;\runtime&quot; <p>Either set the <code>HELIX_RUNTIME</code> environment variable to point to the runtime files using the Windows setting (search for
<code>Edit environment variables for your account</code>) or use the <code>setx</code> command in
Cmd:</p>
<pre><code class="language-sh">setx HELIX_RUNTIME &quot;%userprofile%\source\repos\helix\runtime&quot;
</code></pre> </code></pre>
<p>The runtime location can be overridden via the <code>HELIX_RUNTIME</code> environment variable.</p>
<blockquote> <blockquote>
<p>NOTE: if <code>HELIX_RUNTIME</code> is set prior to calling <code>cargo install --path helix-term --locked</code>, <p>💡 <code>%userprofile%</code> resolves to your user directory like
tree-sitter grammars will be built in <code>$HELIX_RUNTIME/grammars</code>.</p> <code>C:\Users\Your-Name\</code> for example.</p>
</blockquote> </blockquote>
<p>If you plan on keeping the repo locally, an alternative to copying/symlinking <p>Or, create a symlink in <code>%appdata%\helix\</code> that links to the source code directory:</p>
runtime files is to set <code>HELIX_RUNTIME=/path/to/helix/runtime</code> <p>| Method | Command |
(<code>HELIX_RUNTIME=$PWD/runtime</code> if you're in the helix repo directory).</p> | ---------- | -------------------------------------------------------------------------------------- |
<p>To use Helix in desktop environments that supports <a href="https://specifications.freedesktop.org/menu-spec/menu-spec-latest.html">XDG desktop menu</a>, including Gnome and KDE, copy the provided <code>.desktop</code> file to the correct folder:</p> | PowerShell | <code>New-Item -ItemType Junction -Target &quot;runtime&quot; -Path &quot;$Env:AppData\helix\runtime&quot;</code> |
<pre><code class="language-bash">cp contrib/Helix.desktop ~/.local/share/applications | Cmd | <code>cd %appdata%\helix</code> <br/> <code>mklink /D runtime &quot;%userprofile%\src\helix\runtime&quot;</code> |</p>
<blockquote>
<p>💡 On Windows, creating a symbolic link may require running PowerShell or
Cmd as an administrator.</p>
</blockquote>
<h3 id="validating-the-installation"><a class="header" href="#validating-the-installation">Validating the installation</a></h3>
<p>To make sure everything is set up as expected you should run the Helix health
check:</p>
<pre><code class="language-sh">hx --health
</code></pre> </code></pre>
<p>To use another terminal than the default, you will need to modify the <code>.desktop</code> file. For example, to use <code>kitty</code>:</p> <p>For more information on the health check results refer to
<pre><code class="language-bash">sed -i &quot;s|Exec=hx %F|Exec=kitty hx %F|g&quot; ~/.local/share/applications/Helix.desktop <a href="https://github.com/helix-editor/helix/wiki/Healthcheck">Health check</a>.</p>
sed -i &quot;s|Terminal=true|Terminal=false|g&quot; ~/.local/share/applications/Helix.desktop <h3 id="configure-the-desktop-shortcut"><a class="header" href="#configure-the-desktop-shortcut">Configure the desktop shortcut</a></h3>
<p>If your desktop environment supports the
<a href="https://specifications.freedesktop.org/menu-spec/menu-spec-latest.html">XDG desktop menu</a>
you can configure Helix to show up in the application menu by copying the
provided <code>.desktop</code> and icon files to their correct folders:</p>
<pre><code class="language-sh">cp contrib/Helix.desktop ~/.local/share/applications
cp contrib/helix.png ~/.icons # or ~/.local/share/icons
</code></pre> </code></pre>
<p>Please note: there is no icon for Helix yet, so the system default will be used.</p> <p>To use another terminal than the system default, you can modify the <code>.desktop</code>
<h2 id="finishing-up-the-installation"><a class="header" href="#finishing-up-the-installation">Finishing up the installation</a></h2> file. For example, to use <code>kitty</code>:</p>
<p>To make sure everything is set up as expected you should finally run the helix healthcheck via</p> <pre><code class="language-sh">sed -i &quot;s|Exec=hx %F|Exec=kitty hx %F|g&quot; ~/.local/share/applications/Helix.desktop
<pre><code>hx --health sed -i &quot;s|Terminal=true|Terminal=false|g&quot; ~/.local/share/applications/Helix.desktop
</code></pre> </code></pre>
<p>For more information on the information displayed in the health check results refer to <a href="https://github.com/helix-editor/helix/wiki/Healthcheck">Healthcheck</a>.</p>
<h3 id="building-tree-sitter-grammars"><a class="header" href="#building-tree-sitter-grammars">Building tree-sitter grammars</a></h3>
<p>Tree-sitter grammars must be fetched and compiled if not pre-packaged.
Fetch grammars with <code>hx --grammar fetch</code> (requires <code>git</code>) and compile them
with <code>hx --grammar build</code> (requires a C++ compiler).</p>
<h3 id="installing-language-servers"><a class="header" href="#installing-language-servers">Installing language servers</a></h3>
<p>Language servers can optionally be installed if you want their features (auto-complete, diagnostics etc.).
Follow the <a href="https://github.com/helix-editor/helix/wiki/How-to-install-the-default-language-servers">instructions on the wiki page</a> to add your language servers of choice.</p>
</main> </main>

@ -83,7 +83,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents"> <nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox"> <div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html" class="active"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html"><strong aria-hidden="true">2.3.</strong> Language Support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html"><strong aria-hidden="true">4.2.</strong> Key Remapping</a></li><li class="chapter-item expanded "><a href="languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding Languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding Textobject Queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding Indent Queries</a></li></ol></li></ol> <ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html" class="active"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html"><strong aria-hidden="true">2.3.</strong> Language support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html"><strong aria-hidden="true">4.2.</strong> Key remapping</a></li><li class="chapter-item expanded "><a href="languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding textobject queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding indent queries</a></li></ol></li></ol>
</div> </div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
</nav> </nav>
@ -175,8 +175,8 @@
</li> </li>
</ul> </ul>
</li> </li>
<li><a href="#insert-mode">Insert Mode</a></li> <li><a href="#insert-mode">Insert mode</a></li>
<li><a href="#select--extend-mode">Select / extend mode</a></li> <li><a href="#select-extend-mode">Select / extend mode</a></li>
<li><a href="#picker">Picker</a></li> <li><a href="#picker">Picker</a></li>
<li><a href="#prompt">Prompt</a></li> <li><a href="#prompt">Prompt</a></li>
</ul> </ul>
@ -184,7 +184,7 @@
<p>💡 Mappings marked (<strong>LSP</strong>) require an active language server for the file.</p> <p>💡 Mappings marked (<strong>LSP</strong>) require an active language server for the file.</p>
</blockquote> </blockquote>
<blockquote> <blockquote>
<p>💡 Mappings marked (<strong>TS</strong>) require a tree-sitter grammar for the filetype.</p> <p>💡 Mappings marked (<strong>TS</strong>) require a tree-sitter grammar for the file type.</p>
</blockquote> </blockquote>
<h2 id="normal-mode"><a class="header" href="#normal-mode">Normal mode</a></h2> <h2 id="normal-mode"><a class="header" href="#normal-mode">Normal mode</a></h2>
<h3 id="movement"><a class="header" href="#movement">Movement</a></h3> <h3 id="movement"><a class="header" href="#movement">Movement</a></h3>
@ -266,7 +266,7 @@
<h3 id="selection-manipulation"><a class="header" href="#selection-manipulation">Selection manipulation</a></h3> <h3 id="selection-manipulation"><a class="header" href="#selection-manipulation">Selection manipulation</a></h3>
<div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Command</th></tr></thead><tbody> <div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Command</th></tr></thead><tbody>
<tr><td><code>s</code></td><td>Select all regex matches inside selections</td><td><code>select_regex</code></td></tr> <tr><td><code>s</code></td><td>Select all regex matches inside selections</td><td><code>select_regex</code></td></tr>
<tr><td><code>S</code></td><td>Split selection into subselections on regex matches</td><td><code>split_selection</code></td></tr> <tr><td><code>S</code></td><td>Split selection into sub selections on regex matches</td><td><code>split_selection</code></td></tr>
<tr><td><code>Alt-s</code></td><td>Split selection on newlines</td><td><code>split_selection_on_newline</code></td></tr> <tr><td><code>Alt-s</code></td><td>Split selection on newlines</td><td><code>split_selection_on_newline</code></td></tr>
<tr><td><code>Alt-_ </code></td><td>Merge consecutive selections</td><td><code>merge_consecutive_selections</code></td></tr> <tr><td><code>Alt-_ </code></td><td>Merge consecutive selections</td><td><code>merge_consecutive_selections</code></td></tr>
<tr><td><code>&amp;</code></td><td>Align selection in columns</td><td><code>align_selections</code></td></tr> <tr><td><code>&amp;</code></td><td>Align selection in columns</td><td><code>align_selections</code></td></tr>
@ -298,7 +298,7 @@
</tbody></table> </tbody></table>
</div> </div>
<h3 id="search"><a class="header" href="#search">Search</a></h3> <h3 id="search"><a class="header" href="#search">Search</a></h3>
<p>Search commands all operate on the <code>/</code> register by default. Use <code>&quot;&lt;char&gt;</code> to operate on a different one.</p> <p>Search commands all operate on the <code>/</code> register by default. To use a different register, use <code>&quot;&lt;char&gt;</code>.</p>
<div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Command</th></tr></thead><tbody> <div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Command</th></tr></thead><tbody>
<tr><td><code>/</code></td><td>Search for regex pattern</td><td><code>search</code></td></tr> <tr><td><code>/</code></td><td>Search for regex pattern</td><td><code>search</code></td></tr>
<tr><td><code>?</code></td><td>Search for previous pattern</td><td><code>rsearch</code></td></tr> <tr><td><code>?</code></td><td>Search for previous pattern</td><td><code>rsearch</code></td></tr>
@ -326,9 +326,8 @@
<p>Accessed by typing <code>z</code> in <a href="#normal-mode">normal mode</a>.</p> <p>Accessed by typing <code>z</code> in <a href="#normal-mode">normal mode</a>.</p>
<p>View mode is intended for scrolling and manipulating the view without changing <p>View mode is intended for scrolling and manipulating the view without changing
the selection. The &quot;sticky&quot; variant of this mode (accessed by typing <code>Z</code> in the selection. The &quot;sticky&quot; variant of this mode (accessed by typing <code>Z</code> in
normal mode) is persistent; use the Escape key to return to normal mode after normal mode) is persistent and can be exited using the escape key. This is
usage (useful when you're simply looking over text and not actively editing useful when you're simply looking over text and not actively editing it.</p>
it).</p>
<div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Command</th></tr></thead><tbody> <div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Command</th></tr></thead><tbody>
<tr><td><code>z</code>, <code>c</code></td><td>Vertically center the line</td><td><code>align_view_center</code></td></tr> <tr><td><code>z</code>, <code>c</code></td><td>Vertically center the line</td><td><code>align_view_center</code></td></tr>
<tr><td><code>t</code></td><td>Align the line to the top of the screen</td><td><code>align_view_top</code></td></tr> <tr><td><code>t</code></td><td>Align the line to the top of the screen</td><td><code>align_view_top</code></td></tr>
@ -369,7 +368,7 @@ it).</p>
<h4 id="match-mode"><a class="header" href="#match-mode">Match mode</a></h4> <h4 id="match-mode"><a class="header" href="#match-mode">Match mode</a></h4>
<p>Accessed by typing <code>m</code> in <a href="#normal-mode">normal mode</a>.</p> <p>Accessed by typing <code>m</code> in <a href="#normal-mode">normal mode</a>.</p>
<p>See the relevant section in <a href="./usage.html">Usage</a> for an explanation about <p>See the relevant section in <a href="./usage.html">Usage</a> for an explanation about
<a href="./usage.html#surround">surround</a> and <a href="./usage.html#textobjects">textobject</a> usage.</p> <a href="./usage.html#surround">surround</a> and <a href="./usage.html#navigating-using-tree-sitter-textobjects">textobject</a> usage.</p>
<div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Command</th></tr></thead><tbody> <div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Command</th></tr></thead><tbody>
<tr><td><code>m</code></td><td>Goto matching bracket (<strong>TS</strong>)</td><td><code>match_brackets</code></td></tr> <tr><td><code>m</code></td><td>Goto matching bracket (<strong>TS</strong>)</td><td><code>match_brackets</code></td></tr>
<tr><td><code>s</code> <code>&lt;char&gt;</code></td><td>Surround current selection with <code>&lt;char&gt;</code></td><td><code>surround_add</code></td></tr> <tr><td><code>s</code> <code>&lt;char&gt;</code></td><td>Surround current selection with <code>&lt;char&gt;</code></td><td><code>surround_add</code></td></tr>
@ -382,7 +381,7 @@ it).</p>
<p>TODO: Mappings for selecting syntax nodes (a superset of <code>[</code>).</p> <p>TODO: Mappings for selecting syntax nodes (a superset of <code>[</code>).</p>
<h4 id="window-mode"><a class="header" href="#window-mode">Window mode</a></h4> <h4 id="window-mode"><a class="header" href="#window-mode">Window mode</a></h4>
<p>Accessed by typing <code>Ctrl-w</code> in <a href="#normal-mode">normal mode</a>.</p> <p>Accessed by typing <code>Ctrl-w</code> in <a href="#normal-mode">normal mode</a>.</p>
<p>This layer is similar to Vim keybindings as Kakoune does not support window.</p> <p>This layer is similar to Vim keybindings as Kakoune does not support windows.</p>
<div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Command</th></tr></thead><tbody> <div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Command</th></tr></thead><tbody>
<tr><td><code>w</code>, <code>Ctrl-w</code></td><td>Switch to next window</td><td><code>rotate_view</code></td></tr> <tr><td><code>w</code>, <code>Ctrl-w</code></td><td>Switch to next window</td><td><code>rotate_view</code></td></tr>
<tr><td><code>v</code>, <code>Ctrl-v</code></td><td>Vertical right split</td><td><code>vsplit</code></td></tr> <tr><td><code>v</code>, <code>Ctrl-v</code></td><td>Vertical right split</td><td><code>vsplit</code></td></tr>
@ -430,7 +429,7 @@ it).</p>
</tbody></table> </tbody></table>
</div> </div>
<blockquote> <blockquote>
<p>TIP: Global search displays results in a fuzzy picker, use <code>Space + '</code> to bring it back up after opening a file.</p> <p>💡 Global search displays results in a fuzzy picker, use <code>Space + '</code> to bring it back up after opening a file.</p>
</blockquote> </blockquote>
<h5 id="popup"><a class="header" href="#popup">Popup</a></h5> <h5 id="popup"><a class="header" href="#popup">Popup</a></h5>
<p>Displays documentation for item under cursor.</p> <p>Displays documentation for item under cursor.</p>
@ -440,7 +439,7 @@ it).</p>
</tbody></table> </tbody></table>
</div> </div>
<h4 id="unimpaired"><a class="header" href="#unimpaired">Unimpaired</a></h4> <h4 id="unimpaired"><a class="header" href="#unimpaired">Unimpaired</a></h4>
<p>Mappings in the style of <a href="https://github.com/tpope/vim-unimpaired">vim-unimpaired</a>.</p> <p>These mappings are in the style of <a href="https://github.com/tpope/vim-unimpaired">vim-unimpaired</a>.</p>
<div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Command</th></tr></thead><tbody> <div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Command</th></tr></thead><tbody>
<tr><td><code>]d</code></td><td>Go to next diagnostic (<strong>LSP</strong>)</td><td><code>goto_next_diag</code></td></tr> <tr><td><code>]d</code></td><td>Go to next diagnostic (<strong>LSP</strong>)</td><td><code>goto_next_diag</code></td></tr>
<tr><td><code>[d</code></td><td>Go to previous diagnostic (<strong>LSP</strong>)</td><td><code>goto_prev_diag</code></td></tr> <tr><td><code>[d</code></td><td>Go to previous diagnostic (<strong>LSP</strong>)</td><td><code>goto_prev_diag</code></td></tr>
@ -467,12 +466,14 @@ it).</p>
</tbody></table> </tbody></table>
</div> </div>
<h2 id="insert-mode"><a class="header" href="#insert-mode">Insert mode</a></h2> <h2 id="insert-mode"><a class="header" href="#insert-mode">Insert mode</a></h2>
<p>Insert mode bindings are somewhat minimal by default. Helix is designed to <p>Insert mode bindings are minimal by default. Helix is designed to
be a modal editor, and this is reflected in the user experience and internal be a modal editor, and this is reflected in the user experience and internal
mechanics. For example, changes to the text are only saved for undos when mechanics. Changes to the text are only saved for undos when
escaping from insert mode to normal mode. For this reason, new users are escaping from insert mode to normal mode.</p>
strongly encouraged to learn the modal editing paradigm to get the smoothest <blockquote>
experience.</p> <p>💡 New users are strongly encouraged to learn the modal editing paradigm
to get the smoothest experience.</p>
</blockquote>
<div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Command</th></tr></thead><tbody> <div class="table-wrapper"><table><thead><tr><th>Key</th><th>Description</th><th>Command</th></tr></thead><tbody>
<tr><td><code>Escape</code></td><td>Switch to normal mode</td><td><code>normal_mode</code></td></tr> <tr><td><code>Escape</code></td><td>Switch to normal mode</td><td><code>normal_mode</code></td></tr>
<tr><td><code>Ctrl-s</code></td><td>Commit undo checkpoint</td><td><code>commit_undo_checkpoint</code></td></tr> <tr><td><code>Ctrl-s</code></td><td>Commit undo checkpoint</td><td><code>commit_undo_checkpoint</code></td></tr>
@ -500,8 +501,8 @@ with modal editors.</p>
<tr><td><code>End</code></td><td>Move to line end</td><td><code>goto_line_end_newline</code></td></tr> <tr><td><code>End</code></td><td>Move to line end</td><td><code>goto_line_end_newline</code></td></tr>
</tbody></table> </tbody></table>
</div> </div>
<p>If you want to disable them in insert mode as you become more comfortable with modal editing, you can use <p>As you become more comfortable with modal editing, you may want to disable some
the following in your <code>config.toml</code>:</p> insert mode bindings. You can do this by editing your <code>config.toml</code> file.</p>
<pre><code class="language-toml">[keys.insert] <pre><code class="language-toml">[keys.insert]
up = &quot;no_op&quot; up = &quot;no_op&quot;
down = &quot;no_op&quot; down = &quot;no_op&quot;
@ -513,7 +514,7 @@ home = &quot;no_op&quot;
end = &quot;no_op&quot; end = &quot;no_op&quot;
</code></pre> </code></pre>
<h2 id="select--extend-mode"><a class="header" href="#select--extend-mode">Select / extend mode</a></h2> <h2 id="select--extend-mode"><a class="header" href="#select--extend-mode">Select / extend mode</a></h2>
<p>This mode echoes Normal mode, but changes any movements to extend <p>Select mode echoes Normal mode, but changes any movements to extend
selections rather than replace them. Goto motions are also changed to selections rather than replace them. Goto motions are also changed to
extend, so that <code>vgl</code> for example extends the selection to the end of extend, so that <code>vgl</code> for example extends the selection to the end of
the line.</p> the line.</p>

@ -3,7 +3,7 @@
<head> <head>
<!-- Book generated using mdBook --> <!-- Book generated using mdBook -->
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Language Support</title> <title>Language support</title>
<!-- Custom HTML head --> <!-- Custom HTML head -->
@ -83,7 +83,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents"> <nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox"> <div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html" class="active"><strong aria-hidden="true">2.3.</strong> Language Support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html"><strong aria-hidden="true">4.2.</strong> Key Remapping</a></li><li class="chapter-item expanded "><a href="languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding Languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding Textobject Queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding Indent Queries</a></li></ol></li></ol> <ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html" class="active"><strong aria-hidden="true">2.3.</strong> Language support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html"><strong aria-hidden="true">4.2.</strong> Key remapping</a></li><li class="chapter-item expanded "><a href="languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding textobject queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding indent queries</a></li></ol></li></ol>
</div> </div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
</nav> </nav>
@ -148,10 +148,10 @@
<div id="content" class="content"> <div id="content" class="content">
<main> <main>
<h1 id="language-support"><a class="header" href="#language-support">Language Support</a></h1> <h1 id="language-support"><a class="header" href="#language-support">Language Support</a></h1>
<p>The following languages and Language Servers are supported. In order to use <p>The following languages and Language Servers are supported. To use
Language Server features, you must first <a href="https://github.com/helix-editor/helix/wiki/How-to-install-the-default-language-servers">install</a> the Language Server features, you must first <a href="https://github.com/helix-editor/helix/wiki/How-to-install-the-default-language-servers">install</a> the
appropriate Language Server.</p> appropriate Language Server.</p>
<p>Check the language support in your installed helix version with <code>hx --health</code>.</p> <p>You can check the language support in your installed helix version with <code>hx --health</code>.</p>
<p>Also see the <a href="./languages.html">Language Configuration</a> docs and the <a href="./guides/adding_languages.html">Adding <p>Also see the <a href="./languages.html">Language Configuration</a> docs and the <a href="./guides/adding_languages.html">Adding
Languages</a> guide for more language configuration information.</p> Languages</a> guide for more language configuration information.</p>
<div class="table-wrapper"><table><thead><tr><th>Language</th><th>Syntax Highlighting</th><th>Treesitter Textobjects</th><th>Auto Indent</th><th>Default LSP</th></tr></thead><tbody> <div class="table-wrapper"><table><thead><tr><th>Language</th><th>Syntax Highlighting</th><th>Treesitter Textobjects</th><th>Auto Indent</th><th>Default LSP</th></tr></thead><tbody>

@ -83,7 +83,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents"> <nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox"> <div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html"><strong aria-hidden="true">2.3.</strong> Language Support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html"><strong aria-hidden="true">4.2.</strong> Key Remapping</a></li><li class="chapter-item expanded "><a href="languages.html" class="active"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding Languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding Textobject Queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding Indent Queries</a></li></ol></li></ol> <ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html"><strong aria-hidden="true">2.3.</strong> Language support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html"><strong aria-hidden="true">4.2.</strong> Key remapping</a></li><li class="chapter-item expanded "><a href="languages.html" class="active"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding textobject queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding indent queries</a></li></ol></li></ol>
</div> </div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
</nav> </nav>
@ -151,22 +151,31 @@
<p>Language-specific settings and settings for language servers are configured <p>Language-specific settings and settings for language servers are configured
in <code>languages.toml</code> files.</p> in <code>languages.toml</code> files.</p>
<h2 id="languagestoml-files"><a class="header" href="#languagestoml-files"><code>languages.toml</code> files</a></h2> <h2 id="languagestoml-files"><a class="header" href="#languagestoml-files"><code>languages.toml</code> files</a></h2>
<p>There are three possible <code>languages.toml</code> files. The first is compiled into <p>There are three possible locations for a <code>languages.toml</code> file:</p>
Helix and lives in the <a href="https://github.com/helix-editor/helix/blob/master/languages.toml">Helix repository</a>. <ol>
This provides the default configurations for languages and language servers.</p> <li>
<p>You may define a <code>languages.toml</code> in your <a href="./configuration.html">configuration directory</a> <p>In the Helix source code, this lives in the
which overrides values from the built-in language configuration. For example <a href="https://github.com/helix-editor/helix/blob/master/languages.toml">Helix repository</a>.
to disable auto-LSP-formatting in Rust:</p> It provides the default configurations for languages and language servers.</p>
</li>
<li>
<p>In your <a href="./configuration.html">configuration directory</a>. This overrides values
from the built-in language configuration. For example to disable
auto-LSP-formatting in Rust:</p>
</li>
</ol>
<pre><code class="language-toml"># in &lt;config_dir&gt;/helix/languages.toml <pre><code class="language-toml"># in &lt;config_dir&gt;/helix/languages.toml
[[language]] [[language]]
name = &quot;rust&quot; name = &quot;rust&quot;
auto-format = false auto-format = false
</code></pre> </code></pre>
<p>Language configuration may also be overridden local to a project by creating <ol start="3">
a <code>languages.toml</code> file under a <code>.helix</code> directory. Its settings will be merged <li>In a <code>.helix</code> folder in your project. Language configuration may also be
with the language configuration in the configuration directory and the built-in overridden local to a project by creating a <code>languages.toml</code> file in a
configuration.</p> <code>.helix</code> folder. Its settings will be merged with the language configuration
in the configuration directory and the built-in configuration.</li>
</ol>
<h2 id="language-configuration"><a class="header" href="#language-configuration">Language configuration</a></h2> <h2 id="language-configuration"><a class="header" href="#language-configuration">Language configuration</a></h2>
<p>Each language is configured by adding a <code>[[language]]</code> section to a <p>Each language is configured by adding a <code>[[language]]</code> section to a
<code>languages.toml</code> file. For example:</p> <code>languages.toml</code> file. For example:</p>
@ -200,7 +209,7 @@ formatter = { command = &quot;mylang-formatter&quot; , args = [&quot;--stdin&quo
</tbody></table> </tbody></table>
</div> </div>
<h3 id="file-type-detection-and-the-file-types-key"><a class="header" href="#file-type-detection-and-the-file-types-key">File-type detection and the <code>file-types</code> key</a></h3> <h3 id="file-type-detection-and-the-file-types-key"><a class="header" href="#file-type-detection-and-the-file-types-key">File-type detection and the <code>file-types</code> key</a></h3>
<p>Helix determines which language configuration to use with the <code>file-types</code> key <p>Helix determines which language configuration to use based on the <code>file-types</code> key
from the above section. <code>file-types</code> is a list of strings or tables, for from the above section. <code>file-types</code> is a list of strings or tables, for
example:</p> example:</p>
<pre><code class="language-toml">file-types = [&quot;Makefile&quot;, &quot;toml&quot;, { suffix = &quot;.git/config&quot; }] <pre><code class="language-toml">file-types = [&quot;Makefile&quot;, &quot;toml&quot;, { suffix = &quot;.git/config&quot; }]

File diff suppressed because it is too large Load Diff

@ -3,7 +3,7 @@
<head> <head>
<!-- Book generated using mdBook --> <!-- Book generated using mdBook -->
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Key Remapping</title> <title>Key remapping</title>
<!-- Custom HTML head --> <!-- Custom HTML head -->
@ -83,7 +83,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents"> <nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox"> <div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html"><strong aria-hidden="true">2.3.</strong> Language Support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html" class="active"><strong aria-hidden="true">4.2.</strong> Key Remapping</a></li><li class="chapter-item expanded "><a href="languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding Languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding Textobject Queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding Indent Queries</a></li></ol></li></ol> <ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html"><strong aria-hidden="true">2.3.</strong> Language support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html" class="active"><strong aria-hidden="true">4.2.</strong> Key remapping</a></li><li class="chapter-item expanded "><a href="languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding textobject queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding indent queries</a></li></ol></li></ol>
</div> </div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
</nav> </nav>
@ -147,17 +147,17 @@
<div id="content" class="content"> <div id="content" class="content">
<main> <main>
<h1 id="key-remapping"><a class="header" href="#key-remapping">Key Remapping</a></h1> <h1 id="key-remapping"><a class="header" href="#key-remapping">Key remapping</a></h1>
<p>One-way key remapping is temporarily supported via a simple TOML configuration <p>Helix currently supports one-way key remapping through a simple TOML configuration
file. (More powerful solutions such as rebinding via commands will be file. (More powerful solutions such as rebinding via commands will be
available in the future).</p> available in the future).</p>
<p>To remap keys, write a <code>config.toml</code> file in your <code>helix</code> configuration <p>To remap keys, create a <code>config.toml</code> file in your <code>helix</code> configuration
directory (default <code>~/.config/helix</code> in Linux systems) with a structure like directory (default <code>~/.config/helix</code> on Linux systems) with a structure like
this:</p> this:</p>
<pre><code class="language-toml"># At most one section each of 'keys.normal', 'keys.insert' and 'keys.select' <pre><code class="language-toml"># At most one section each of 'keys.normal', 'keys.insert' and 'keys.select'
[keys.normal] [keys.normal]
C-s = &quot;:w&quot; # Maps the Ctrl-s to the typable command :w which is an alias for :write (save file) C-s = &quot;:w&quot; # Maps Ctrl-s to the typable command :w which is an alias for :write (save file)
C-o = &quot;:open ~/.config/helix/config.toml&quot; # Maps the Ctrl-o to opening of the helix config file C-o = &quot;:open ~/.config/helix/config.toml&quot; # Maps Ctrl-o to opening of the helix config file
a = &quot;move_char_left&quot; # Maps the 'a' key to the move_char_left command a = &quot;move_char_left&quot; # Maps the 'a' key to the move_char_left command
w = &quot;move_line_up&quot; # Maps the 'w' key move_line_up w = &quot;move_line_up&quot; # Maps the 'w' key move_line_up
&quot;C-S-esc&quot; = &quot;extend_line&quot; # Maps Ctrl-Shift-Escape to extend_line &quot;C-S-esc&quot; = &quot;extend_line&quot; # Maps Ctrl-Shift-Escape to extend_line
@ -168,9 +168,6 @@ g = { a = &quot;code_action&quot; } # Maps `ga` to show possible code actions
&quot;A-x&quot; = &quot;normal_mode&quot; # Maps Alt-X to enter normal mode &quot;A-x&quot; = &quot;normal_mode&quot; # Maps Alt-X to enter normal mode
j = { k = &quot;normal_mode&quot; } # Maps `jk` to exit insert mode j = { k = &quot;normal_mode&quot; } # Maps `jk` to exit insert mode
</code></pre> </code></pre>
<blockquote>
<p>NOTE: Typable commands can also be remapped, remember to keep the <code>:</code> prefix to indicate it's a typable command.</p>
</blockquote>
<h2 id="minor-modes"><a class="header" href="#minor-modes">Minor modes</a></h2> <h2 id="minor-modes"><a class="header" href="#minor-modes">Minor modes</a></h2>
<p>Minor modes are accessed by pressing a key (usually from normal mode), giving access to dedicated bindings. Bindings <p>Minor modes are accessed by pressing a key (usually from normal mode), giving access to dedicated bindings. Bindings
can be modified or added by nesting definitions.</p> can be modified or added by nesting definitions.</p>
@ -215,10 +212,8 @@ t = &quot;:run-shell-command cargo test&quot;
</tbody></table> </tbody></table>
</div> </div>
<p>Keys can be disabled by binding them to the <code>no_op</code> command.</p> <p>Keys can be disabled by binding them to the <code>no_op</code> command.</p>
<p>Commands can be found at <a href="https://docs.helix-editor.com/keymap.html">Keymap</a> Commands.</p> <p>A list of commands is available in the <a href="https://docs.helix-editor.com/keymap.html">Keymap</a> documentation
<blockquote> and in the source code at <a href="https://github.com/helix-editor/helix/blob/master/helix-term/src/commands.rs"><code>helix-term/src/commands.rs</code></a> at the invocation of <code>static_commands!</code> macro and the <code>TypableCommandList</code>.</p>
<p>Commands can also be found in the source code at <a href="https://github.com/helix-editor/helix/blob/master/helix-term/src/commands.rs"><code>helix-term/src/commands.rs</code></a> at the invocation of <code>static_commands!</code> macro and the <code>TypableCommandList</code>.</p>
</blockquote>
</main> </main>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -83,7 +83,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents"> <nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox"> <div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html"><strong aria-hidden="true">2.3.</strong> Language Support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html" class="active"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html"><strong aria-hidden="true">4.2.</strong> Key Remapping</a></li><li class="chapter-item expanded "><a href="languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding Languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding Textobject Queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding Indent Queries</a></li></ol></li></ol> <ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html"><strong aria-hidden="true">2.3.</strong> Language support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html" class="active"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html"><strong aria-hidden="true">4.2.</strong> Key remapping</a></li><li class="chapter-item expanded "><a href="languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding textobject queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding indent queries</a></li></ol></li></ol>
</div> </div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
</nav> </nav>
@ -148,23 +148,35 @@
<div id="content" class="content"> <div id="content" class="content">
<main> <main>
<h1 id="themes"><a class="header" href="#themes">Themes</a></h1> <h1 id="themes"><a class="header" href="#themes">Themes</a></h1>
<p>To use a theme add <code>theme = &quot;&lt;name&gt;&quot;</code> to your <a href="./configuration.html"><code>config.toml</code></a> at the very top of the file before the first section or select it during runtime using <code>:theme &lt;name&gt;</code>.</p> <p>To use a theme add <code>theme = &quot;&lt;name&gt;&quot;</code> to the top of your <a href="./configuration.html"><code>config.toml</code></a> file, or select it during runtime using <code>:theme &lt;name&gt;</code>.</p>
<h2 id="creating-a-theme"><a class="header" href="#creating-a-theme">Creating a theme</a></h2> <h2 id="creating-a-theme"><a class="header" href="#creating-a-theme">Creating a theme</a></h2>
<p>Create a file with the name of your theme as file name (i.e <code>mytheme.toml</code>) and place it in your <code>themes</code> directory (i.e <code>~/.config/helix/themes</code>). The directory might have to be created beforehand.</p> <p>Create a file with the name of your theme as the file name (i.e <code>mytheme.toml</code>) and place it in your <code>themes</code> directory (i.e <code>~/.config/helix/themes</code> or <code>%AppData%\helix\themes</code> on Windows). The directory might have to be created beforehand.</p>
<p>The names &quot;default&quot; and &quot;base16_default&quot; are reserved for the builtin themes and cannot be overridden by user defined themes.</p> <blockquote>
<p>The default theme.toml can be found <a href="https://github.com/helix-editor/helix/blob/master/theme.toml">here</a>, and user submitted themes <a href="https://github.com/helix-editor/helix/blob/master/runtime/themes">here</a>. </p> <p>💡 The names &quot;default&quot; and &quot;base16_default&quot; are reserved for built-in themes
and cannot be overridden by user-defined themes.</p>
</blockquote>
<h3 id="overview"><a class="header" href="#overview">Overview</a></h3>
<p>Each line in the theme file is specified as below:</p> <p>Each line in the theme file is specified as below:</p>
<pre><code class="language-toml">key = { fg = &quot;#ffffff&quot;, bg = &quot;#000000&quot;, underline = { color = &quot;#ff0000&quot;, style = &quot;curl&quot;}, modifiers = [&quot;bold&quot;, &quot;italic&quot;] } <pre><code class="language-toml">key = { fg = &quot;#ffffff&quot;, bg = &quot;#000000&quot;, underline = { color = &quot;#ff0000&quot;, style = &quot;curl&quot;}, modifiers = [&quot;bold&quot;, &quot;italic&quot;] }
</code></pre> </code></pre>
<p>where <code>key</code> represents what you want to style, <code>fg</code> specifies the foreground color, <code>bg</code> the background color, <code>underline</code> the underline <code>style</code>/<code>color</code>, and <code>modifiers</code> is a list of style modifiers. <code>bg</code>, <code>underline</code> and <code>modifiers</code> can be omitted to defer to the defaults.</p> <p>Where <code>key</code> represents what you want to style, <code>fg</code> specifies the foreground color, <code>bg</code> the background color, <code>underline</code> the underline <code>style</code>/<code>color</code>, and <code>modifiers</code> is a list of style modifiers. <code>bg</code>, <code>underline</code> and <code>modifiers</code> can be omitted to defer to the defaults.</p>
<p>To specify only the foreground color:</p> <p>To specify only the foreground color:</p>
<pre><code class="language-toml">key = &quot;#ffffff&quot; <pre><code class="language-toml">key = &quot;#ffffff&quot;
</code></pre> </code></pre>
<p>if the key contains a dot <code>'.'</code>, it must be quoted to prevent it being parsed as a <a href="https://toml.io/en/v1.0.0#keys">dotted key</a>.</p> <p>If the key contains a dot <code>'.'</code>, it must be quoted to prevent it being parsed as a <a href="https://toml.io/en/v1.0.0#keys">dotted key</a>.</p>
<pre><code class="language-toml">&quot;key.key&quot; = &quot;#ffffff&quot; <pre><code class="language-toml">&quot;key.key&quot; = &quot;#ffffff&quot;
</code></pre> </code></pre>
<p>For inspiration, you can find the default <code>theme.toml</code>
<a href="https://github.com/helix-editor/helix/blob/master/theme.toml">here</a> and
user-submitted themes
<a href="https://github.com/helix-editor/helix/blob/master/runtime/themes">here</a>.</p>
<h3 id="using-the-linter"><a class="header" href="#using-the-linter">Using the linter</a></h3>
<p>Use the supplied linting tool to check for errors and missing scopes:</p>
<pre><code class="language-sh">cargo xtask themelint onedark # replace onedark with &lt;name&gt;
</code></pre>
<h2 id="the-details-of-theme-creation"><a class="header" href="#the-details-of-theme-creation">The details of theme creation</a></h2>
<h3 id="color-palettes"><a class="header" href="#color-palettes">Color palettes</a></h3> <h3 id="color-palettes"><a class="header" href="#color-palettes">Color palettes</a></h3>
<p>It's recommended define a palette of named colors, and refer to them from the <p>It's recommended to define a palette of named colors, and refer to them in the
configuration values in your theme. To do this, add a table called configuration values in your theme. To do this, add a table called
<code>palette</code> to your theme file:</p> <code>palette</code> to your theme file:</p>
<pre><code class="language-toml">&quot;ui.background&quot; = &quot;white&quot; <pre><code class="language-toml">&quot;ui.background&quot; = &quot;white&quot;
@ -174,8 +186,8 @@ configuration values in your theme. To do this, add a table called
white = &quot;#ffffff&quot; white = &quot;#ffffff&quot;
black = &quot;#000000&quot; black = &quot;#000000&quot;
</code></pre> </code></pre>
<p>Remember that the <code>[palette]</code> table includes all keys after its header, <p>Keep in mind that the <code>[palette]</code> table includes all keys after its header,
so you should define the palette after normal theme options.</p> so it should be defined after the normal theme options.</p>
<p>The default palette uses the terminal's default 16 colors, and the colors names <p>The default palette uses the terminal's default 16 colors, and the colors names
are listed below. The <code>[palette]</code> section in the config file takes precedence are listed below. The <code>[palette]</code> section in the config file takes precedence
over it and is merged into the default palette.</p> over it and is merged into the default palette.</p>
@ -199,8 +211,8 @@ over it and is merged into the default palette.</p>
</tbody></table> </tbody></table>
</div> </div>
<h3 id="modifiers"><a class="header" href="#modifiers">Modifiers</a></h3> <h3 id="modifiers"><a class="header" href="#modifiers">Modifiers</a></h3>
<p>The following values may be used as modifiers. </p> <p>The following values may be used as modifier, provided they are supported by
<p>Less common modifiers might not be supported by your terminal emulator.</p> your terminal emulator.</p>
<div class="table-wrapper"><table><thead><tr><th>Modifier</th></tr></thead><tbody> <div class="table-wrapper"><table><thead><tr><th>Modifier</th></tr></thead><tbody>
<tr><td><code>bold</code></td></tr> <tr><td><code>bold</code></td></tr>
<tr><td><code>dim</code></td></tr> <tr><td><code>dim</code></td></tr>
@ -214,12 +226,12 @@ over it and is merged into the default palette.</p>
</tbody></table> </tbody></table>
</div> </div>
<blockquote> <blockquote>
<p>Note: The <code>underlined</code> modifier is deprecated and only available for backwards compatibility. <p>💡 The <code>underlined</code> modifier is deprecated and only available for backwards compatibility.
Its behavior is equivalent to setting <code>underline.style=&quot;line&quot;</code>.</p> Its behavior is equivalent to setting <code>underline.style=&quot;line&quot;</code>.</p>
</blockquote> </blockquote>
<h3 id="underline-style"><a class="header" href="#underline-style">Underline Style</a></h3> <h3 id="underline-style"><a class="header" href="#underline-style">Underline style</a></h3>
<p>One of the following values may be used as a value for <code>underline.style</code>. </p> <p>One of the following values may be used as a value for <code>underline.style</code>, providing it is
<p>Some styles might not be supported by your terminal emulator.</p> supported by your terminal emulator.</p>
<div class="table-wrapper"><table><thead><tr><th>Modifier</th></tr></thead><tbody> <div class="table-wrapper"><table><thead><tr><th>Modifier</th></tr></thead><tbody>
<tr><td><code>line</code></td></tr> <tr><td><code>line</code></td></tr>
<tr><td><code>curl</code></td></tr> <tr><td><code>curl</code></td></tr>
@ -229,7 +241,7 @@ Its behavior is equivalent to setting <code>underline.style=&quot;line&quot;</co
</tbody></table> </tbody></table>
</div> </div>
<h3 id="inheritance"><a class="header" href="#inheritance">Inheritance</a></h3> <h3 id="inheritance"><a class="header" href="#inheritance">Inheritance</a></h3>
<p>Extend upon other themes by setting the <code>inherits</code> property to an existing theme.</p> <p>Extend other themes by setting the <code>inherits</code> property to an existing theme.</p>
<pre><code class="language-toml">inherits = &quot;boo_berry&quot; <pre><code class="language-toml">inherits = &quot;boo_berry&quot;
# Override the theming for &quot;keyword&quot;s: # Override the theming for &quot;keyword&quot;s:
@ -240,16 +252,16 @@ Its behavior is equivalent to setting <code>underline.style=&quot;line&quot;</co
berry = &quot;#2A2A4D&quot; berry = &quot;#2A2A4D&quot;
</code></pre> </code></pre>
<h3 id="scopes"><a class="header" href="#scopes">Scopes</a></h3> <h3 id="scopes"><a class="header" href="#scopes">Scopes</a></h3>
<p>The following is a list of scopes available to use for styling.</p> <p>The following is a list of scopes available to use for styling:</p>
<h4 id="syntax-highlighting"><a class="header" href="#syntax-highlighting">Syntax highlighting</a></h4> <h4 id="syntax-highlighting"><a class="header" href="#syntax-highlighting">Syntax highlighting</a></h4>
<p>These keys match <a href="https://tree-sitter.github.io/tree-sitter/syntax-highlighting#theme">tree-sitter scopes</a>.</p> <p>These keys match <a href="https://tree-sitter.github.io/tree-sitter/syntax-highlighting#theme">tree-sitter scopes</a>.</p>
<p>For a given highlight produced, styling will be determined based on the longest matching theme key. For example, the highlight <code>function.builtin.static</code> would match the key <code>function.builtin</code> rather than <code>function</code>.</p> <p>When determining styling for a highlight, the longest matching theme key will be used. For example, if the highlight is <code>function.builtin.static</code>, the key <code>function.builtin</code> will be used instead of <code>function</code>.</p>
<p>We use a similar set of scopes as <p>We use a similar set of scopes as
<a href="https://www.sublimetext.com/docs/scope_naming.html">SublimeText</a>. See also <a href="https://www.sublimetext.com/docs/scope_naming.html">Sublime Text</a>. See also
<a href="https://macromates.com/manual/en/language_grammars">TextMate</a> scopes.</p> <a href="https://macromates.com/manual/en/language_grammars">TextMate</a> scopes.</p>
<ul> <ul>
<li> <li>
<p><code>attribute</code> - Class attributes, html tag attributes</p> <p><code>attribute</code> - Class attributes, HTML tag attributes</p>
</li> </li>
<li> <li>
<p><code>type</code> - Types</p> <p><code>type</code> - Types</p>
@ -266,7 +278,7 @@ berry = &quot;#2A2A4D&quot;
<p><code>constructor</code></p> <p><code>constructor</code></p>
</li> </li>
<li> <li>
<p><code>constant</code> (TODO: constant.other.placeholder for %v)</p> <p><code>constant</code> (TODO: constant.other.placeholder for <code>%v</code>)</p>
<ul> <ul>
<li><code>builtin</code> Special constants provided by the language (<code>true</code>, <code>false</code>, <code>nil</code> etc) <li><code>builtin</code> Special constants provided by the language (<code>true</code>, <code>false</code>, <code>nil</code> etc)
<ul> <ul>
@ -313,7 +325,7 @@ berry = &quot;#2A2A4D&quot;
<li> <li>
<p><code>variable</code> - Variables</p> <p><code>variable</code> - Variables</p>
<ul> <ul>
<li><code>builtin</code> - Reserved language variables (<code>self</code>, <code>this</code>, <code>super</code>, etc)</li> <li><code>builtin</code> - Reserved language variables (<code>self</code>, <code>this</code>, <code>super</code>, etc.)</li>
<li><code>parameter</code> - Function parameters</li> <li><code>parameter</code> - Function parameters</li>
<li><code>other</code> <li><code>other</code>
<ul> <ul>
@ -346,11 +358,11 @@ berry = &quot;#2A2A4D&quot;
</ul> </ul>
</li> </li>
<li><code>operator</code> - <code>or</code>, <code>in</code></li> <li><code>operator</code> - <code>or</code>, <code>in</code></li>
<li><code>directive</code> - Preprocessor directives (<code>#if</code> in C) </li> <li><code>directive</code> - Preprocessor directives (<code>#if</code> in C)</li>
<li><code>function</code> - <code>fn</code>, <code>func</code></li> <li><code>function</code> - <code>fn</code>, <code>func</code></li>
<li><code>storage</code> - Keywords describing how things are stored <li><code>storage</code> - Keywords describing how things are stored
<ul> <ul>
<li><code>type</code> - The type of something, <code>class</code>, <code>function</code>, <code>var</code>, <code>let</code>, etc. </li> <li><code>type</code> - The type of something, <code>class</code>, <code>function</code>, <code>var</code>, <code>let</code>, etc.</li>
<li><code>modifier</code> - Storage modifiers like <code>static</code>, <code>mut</code>, <code>const</code>, <code>ref</code>, etc.</li> <li><code>modifier</code> - Storage modifiers like <code>static</code>, <code>mut</code>, <code>const</code>, <code>ref</code>, etc.</li>
</ul> </ul>
</li> </li>
@ -396,9 +408,9 @@ berry = &quot;#2A2A4D&quot;
<li><code>italic</code></li> <li><code>italic</code></li>
<li><code>link</code> <li><code>link</code>
<ul> <ul>
<li><code>url</code> - urls pointed to by links</li> <li><code>url</code> - URLs pointed to by links</li>
<li><code>label</code> - non-url link references</li> <li><code>label</code> - non-URL link references</li>
<li><code>text</code> - url and image descriptions in links</li> <li><code>text</code> - URL and image descriptions in links</li>
</ul> </ul>
</li> </li>
<li><code>quote</code></li> <li><code>quote</code></li>
@ -424,28 +436,28 @@ berry = &quot;#2A2A4D&quot;
</li> </li>
</ul> </ul>
<h4 id="interface"><a class="header" href="#interface">Interface</a></h4> <h4 id="interface"><a class="header" href="#interface">Interface</a></h4>
<p>These scopes are used for theming the editor interface.</p> <p>These scopes are used for theming the editor interface:</p>
<ul> <ul>
<li><code>markup</code> <li><code>markup</code>
<ul> <ul>
<li><code>normal</code> <li><code>normal</code>
<ul> <ul>
<li><code>completion</code> - for completion doc popup ui</li> <li><code>completion</code> - for completion doc popup UI</li>
<li><code>hover</code> - for hover popup ui</li> <li><code>hover</code> - for hover popup UI</li>
</ul> </ul>
</li> </li>
<li><code>heading</code> <li><code>heading</code>
<ul> <ul>
<li><code>completion</code> - for completion doc popup ui</li> <li><code>completion</code> - for completion doc popup UI</li>
<li><code>hover</code> - for hover popup ui</li> <li><code>hover</code> - for hover popup UI</li>
</ul> </ul>
</li> </li>
<li><code>raw</code> <li><code>raw</code>
<ul> <ul>
<li><code>inline</code> <li><code>inline</code>
<ul> <ul>
<li><code>completion</code> - for completion doc popup ui</li> <li><code>completion</code> - for completion doc popup UI</li>
<li><code>hover</code> - for hover popup ui</li> <li><code>hover</code> - for hover popup UI</li>
</ul> </ul>
</li> </li>
</ul> </ul>
@ -475,9 +487,9 @@ berry = &quot;#2A2A4D&quot;
<tr><td><code>ui.statusline.insert</code></td><td>Statusline mode during insert mode (<a href="./configuration.html#editor-section">only if <code>editor.color-modes</code> is enabled</a>)</td></tr> <tr><td><code>ui.statusline.insert</code></td><td>Statusline mode during insert mode (<a href="./configuration.html#editor-section">only if <code>editor.color-modes</code> is enabled</a>)</td></tr>
<tr><td><code>ui.statusline.select</code></td><td>Statusline mode during select mode (<a href="./configuration.html#editor-section">only if <code>editor.color-modes</code> is enabled</a>)</td></tr> <tr><td><code>ui.statusline.select</code></td><td>Statusline mode during select mode (<a href="./configuration.html#editor-section">only if <code>editor.color-modes</code> is enabled</a>)</td></tr>
<tr><td><code>ui.statusline.separator</code></td><td>Separator character in statusline</td></tr> <tr><td><code>ui.statusline.separator</code></td><td>Separator character in statusline</td></tr>
<tr><td><code>ui.popup</code></td><td>Documentation popups (e.g Space + k)</td></tr> <tr><td><code>ui.popup</code></td><td>Documentation popups (e.g. Space + k)</td></tr>
<tr><td><code>ui.popup.info</code></td><td>Prompt for multiple key options</td></tr> <tr><td><code>ui.popup.info</code></td><td>Prompt for multiple key options</td></tr>
<tr><td><code>ui.window</code></td><td>Border lines separating splits</td></tr> <tr><td><code>ui.window</code></td><td>Borderlines separating splits</td></tr>
<tr><td><code>ui.help</code></td><td>Description box for commands</td></tr> <tr><td><code>ui.help</code></td><td>Description box for commands</td></tr>
<tr><td><code>ui.text</code></td><td>Command prompts, popup text, etc.</td></tr> <tr><td><code>ui.text</code></td><td>Command prompts, popup text, etc.</td></tr>
<tr><td><code>ui.text.focus</code></td><td></td></tr> <tr><td><code>ui.text.focus</code></td><td></td></tr>
@ -507,10 +519,6 @@ berry = &quot;#2A2A4D&quot;
<tr><td><code>diagnostic.error</code></td><td>Diagnostics error (editing area)</td></tr> <tr><td><code>diagnostic.error</code></td><td>Diagnostics error (editing area)</td></tr>
</tbody></table> </tbody></table>
</div> </div>
<p>You can check compliance to spec with</p>
<pre><code class="language-shell">cargo xtask themelint onedark # replace onedark with &lt;name&gt;
</code></pre>
</main> </main>
<nav class="nav-wrapper" aria-label="Page navigation"> <nav class="nav-wrapper" aria-label="Page navigation">

@ -83,7 +83,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents"> <nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox"> <div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html" class="active">Helix</a></li><li class="chapter-item expanded "><a href="install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html"><strong aria-hidden="true">2.3.</strong> Language Support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html"><strong aria-hidden="true">4.2.</strong> Key Remapping</a></li><li class="chapter-item expanded "><a href="languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding Languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding Textobject Queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding Indent Queries</a></li></ol></li></ol> <ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html" class="active">Helix</a></li><li class="chapter-item expanded "><a href="install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html"><strong aria-hidden="true">2.3.</strong> Language support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html"><strong aria-hidden="true">4.2.</strong> Key remapping</a></li><li class="chapter-item expanded "><a href="languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding textobject queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding indent queries</a></li></ol></li></ol>
</div> </div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
</nav> </nav>

@ -83,7 +83,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents"> <nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox"> <div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html" class="active"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html"><strong aria-hidden="true">2.3.</strong> Language Support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html"><strong aria-hidden="true">4.2.</strong> Key Remapping</a></li><li class="chapter-item expanded "><a href="languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding Languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding Textobject Queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding Indent Queries</a></li></ol></li></ol> <ol class="chapter"><li class="chapter-item expanded affix "><a href="title-page.html">Helix</a></li><li class="chapter-item expanded "><a href="install.html"><strong aria-hidden="true">1.</strong> Installation</a></li><li class="chapter-item expanded "><a href="usage.html" class="active"><strong aria-hidden="true">2.</strong> Usage</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="keymap.html"><strong aria-hidden="true">2.1.</strong> Keymap</a></li><li class="chapter-item expanded "><a href="commands.html"><strong aria-hidden="true">2.2.</strong> Commands</a></li><li class="chapter-item expanded "><a href="lang-support.html"><strong aria-hidden="true">2.3.</strong> Language support</a></li></ol></li><li class="chapter-item expanded "><a href="from-vim.html"><strong aria-hidden="true">3.</strong> Migrating from Vim</a></li><li class="chapter-item expanded "><a href="configuration.html"><strong aria-hidden="true">4.</strong> Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="themes.html"><strong aria-hidden="true">4.1.</strong> Themes</a></li><li class="chapter-item expanded "><a href="remapping.html"><strong aria-hidden="true">4.2.</strong> Key remapping</a></li><li class="chapter-item expanded "><a href="languages.html"><strong aria-hidden="true">4.3.</strong> Languages</a></li></ol></li><li class="chapter-item expanded "><a href="guides/index.html"><strong aria-hidden="true">5.</strong> Guides</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="guides/adding_languages.html"><strong aria-hidden="true">5.1.</strong> Adding languages</a></li><li class="chapter-item expanded "><a href="guides/textobject.html"><strong aria-hidden="true">5.2.</strong> Adding textobject queries</a></li><li class="chapter-item expanded "><a href="guides/indent.html"><strong aria-hidden="true">5.3.</strong> Adding indent queries</a></li></ol></li></ol>
</div> </div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
</nav> </nav>
@ -147,21 +147,46 @@
<div id="content" class="content"> <div id="content" class="content">
<main> <main>
<h1 id="usage"><a class="header" href="#usage">Usage</a></h1> <h1 id="using-helix"><a class="header" href="#using-helix">Using Helix</a></h1>
<p>(Currently not fully documented, see the <a href="./keymap.html">keymappings</a> list for more.)</p> <!--toc:start-->
<p>See <a href="https://github.com/helix-editor/helix/blob/master/runtime/tutor">tutor</a> (accessible via <code>hx --tutor</code> or <code>:tutor</code>) for a vimtutor-like introduction.</p> <ul>
<li><a href="#registers">Registers</a>
<ul>
<li><a href="#user-defined-registers">User-defined registers</a></li>
<li><a href="#special-registers">Special registers</a></li>
</ul>
</li>
<li><a href="#surround">Surround</a></li>
<li><a href="#selecting-and-manipulating-text-with-textobjects">Selecting and manipulating text with textobjects</a></li>
<li><a href="#navigating-using-tree-sitter-textobjects">Navigating using tree-sitter textobjects</a></li>
<li><a href="#moving-the-selection-with-syntax-aware-motions">Moving the selection with syntax-aware motions</a></li>
</ul>
<!--toc:end-->
<p>For a full interactive introduction to Helix, refer to the
<a href="https://github.com/helix-editor/helix/blob/master/runtime/tutor">tutor</a> which
can be accessed via the command <code>hx --tutor</code> or <code>:tutor</code>.</p>
<blockquote>
<p>💡 Currently, not all functionality is fully documented, please refer to the
<a href="./keymap.html">key mappings</a> list.</p>
</blockquote>
<h2 id="registers"><a class="header" href="#registers">Registers</a></h2> <h2 id="registers"><a class="header" href="#registers">Registers</a></h2>
<p>Vim-like registers can be used to yank and store text to be pasted later. Usage is similar, with <code>&quot;</code> being used to select a register:</p> <p>In Helix, registers are storage locations for text and other data, such as the
result of a search. Registers can be used to cut, copy, and paste text, similar
to the clipboard in other text editors. Usage is similar to Vim, with <code>&quot;</code> being
used to select a register.</p>
<h3 id="user-defined-registers"><a class="header" href="#user-defined-registers">User-defined registers</a></h3>
<p>Helix allows you to create your own named registers for storing text, for
example:</p>
<ul> <ul>
<li><code>&quot;ay</code> - Yank the current selection to register <code>a</code>.</li> <li><code>&quot;ay</code> - Yank the current selection to register <code>a</code>.</li>
<li><code>&quot;op</code> - Paste the text in register <code>o</code> after the selection.</li> <li><code>&quot;op</code> - Paste the text in register <code>o</code> after the selection.</li>
</ul> </ul>
<p>If there is a selected register before invoking a change or delete command, the selection will be stored in the register and the action will be carried out:</p> <p>If a register is selected before invoking a change or delete command, the selection will be stored in the register and the action will be carried out:</p>
<ul> <ul>
<li><code>&quot;hc</code> - Store the selection in register <code>h</code> and then change it (delete and enter insert mode).</li> <li><code>&quot;hc</code> - Store the selection in register <code>h</code> and then change it (delete and enter insert mode).</li>
<li><code>&quot;md</code> - Store the selection in register <code>m</code> and delete it.</li> <li><code>&quot;md</code> - Store the selection in register <code>m</code> and delete it.</li>
</ul> </ul>
<h3 id="special-registers"><a class="header" href="#special-registers">Special Registers</a></h3> <h3 id="special-registers"><a class="header" href="#special-registers">Special registers</a></h3>
<div class="table-wrapper"><table><thead><tr><th>Register character</th><th>Contains</th></tr></thead><tbody> <div class="table-wrapper"><table><thead><tr><th>Register character</th><th>Contains</th></tr></thead><tbody>
<tr><td><code>/</code></td><td>Last search</td></tr> <tr><td><code>/</code></td><td>Last search</td></tr>
<tr><td><code>:</code></td><td>Last executed command</td></tr> <tr><td><code>:</code></td><td>Last executed command</td></tr>
@ -169,35 +194,76 @@
<tr><td><code>_</code></td><td>Black hole</td></tr> <tr><td><code>_</code></td><td>Black hole</td></tr>
</tbody></table> </tbody></table>
</div> </div>
<blockquote> <p>The system clipboard is not directly supported by a special register. Instead, special commands and keybindings are provided. Refer to the
<p>There is no special register for copying to system clipboard, instead special commands and keybindings are provided. See the <a href="keymap.html#space-mode">keymap</a> for the specifics. <a href="keymap.html#space-mode">key map</a> for more details.</p>
The black hole register works as a no-op register, meaning no data will be written to / read from it.</p> <p>The black hole register is a no-op register, meaning that no data will be read or written to it.</p>
</blockquote>
<h2 id="surround"><a class="header" href="#surround">Surround</a></h2> <h2 id="surround"><a class="header" href="#surround">Surround</a></h2>
<p>Functionality similar to <a href="https://github.com/tpope/vim-surround">vim-surround</a> is built into <p>Helix includes built-in functionality similar to <a href="https://github.com/tpope/vim-surround">vim-surround</a>.
helix. The keymappings have been inspired from <a href="https://github.com/machakann/vim-sandwich">vim-sandwich</a>:</p> The keymappings have been inspired from <a href="https://github.com/machakann/vim-sandwich">vim-sandwich</a>:</p>
<p><img src="https://user-images.githubusercontent.com/23398472/122865801-97073180-d344-11eb-8142-8f43809982c6.gif" alt="surround demo" /></p> <p><img src="https://user-images.githubusercontent.com/23398472/122865801-97073180-d344-11eb-8142-8f43809982c6.gif" alt="Surround demo" /></p>
<ul> <div class="table-wrapper"><table><thead><tr><th>Key Sequence</th><th>Action</th></tr></thead><tbody>
<li><code>ms</code> - Add surround characters</li> <tr><td><code>ms&lt;char&gt;</code> (after selecting text)</td><td>Add surround characters to selection</td></tr>
<li><code>mr</code> - Replace surround characters</li> <tr><td><code>mr&lt;char_to_replace&gt;&lt;new_char&gt;</code></td><td>Replace the closest surround characters</td></tr>
<li><code>md</code> - Delete surround characters</li> <tr><td><code>md&lt;char_to_delete&gt;</code></td><td>Delete the closest surround characters</td></tr>
</ul> </tbody></table>
<p><code>ms</code> acts on a selection, so select the text first and use <code>ms&lt;char&gt;</code>. <code>mr</code> and <code>md</code> work </div>
on the closest pairs found and selections are not required; use counts to act in outer pairs.</p> <p>You can use counts to act on outer pairs.</p>
<p>It can also act on multiple selections (yay!). For example, to change every occurrence of <code>(use)</code> to <code>[use]</code>:</p> <p>Surround can also act on multiple selections. For example, to change every occurrence of <code>(use)</code> to <code>[use]</code>:</p>
<ul> <ol>
<li><code>%</code> to select the whole file</li> <li><code>%</code> to select the whole file</li>
<li><code>s</code> to split the selections on a search term</li> <li><code>s</code> to split the selections on a search term</li>
<li>Input <code>use</code> and hit Enter</li> <li>Input <code>use</code> and hit Enter</li>
<li><code>mr([</code> to replace the parens with square brackets</li> <li><code>mr([</code> to replace the parentheses with square brackets</li>
</ol>
<p>Multiple characters are currently not supported, but planned for future release.</p>
<h2 id="selecting-and-manipulating-text-with-textobjects"><a class="header" href="#selecting-and-manipulating-text-with-textobjects">Selecting and manipulating text with textobjects</a></h2>
<p>In Helix, textobjects are a way to select, manipulate and operate on a piece of
text in a structured way. They allow you to refer to blocks of text based on
their structure or purpose, such as a word, sentence, paragraph, or even a
function or block of code.</p>
<p><img src="https://user-images.githubusercontent.com/23398472/124231131-81a4bb00-db2d-11eb-9d10-8e577ca7b177.gif" alt="Textobject demo" />
<img src="https://user-images.githubusercontent.com/23398472/132537398-2a2e0a54-582b-44ab-a77f-eb818942203d.gif" alt="Textobject tree-sitter demo" /></p>
<ul>
<li><code>ma</code> - Select around the object (<code>va</code> in Vim, <code>&lt;alt-a&gt;</code> in Kakoune)</li>
<li><code>mi</code> - Select inside the object (<code>vi</code> in Vim, <code>&lt;alt-i&gt;</code> in Kakoune)</li>
</ul> </ul>
<p>Multiple characters are currently not supported, but planned.</p> <div class="table-wrapper"><table><thead><tr><th>Key after <code>mi</code> or <code>ma</code></th><th>Textobject selected</th></tr></thead><tbody>
<h2 id="syntax-tree-motions"><a class="header" href="#syntax-tree-motions">Syntax-tree Motions</a></h2> <tr><td><code>w</code></td><td>Word</td></tr>
<p><code>Alt-p</code>, <code>Alt-o</code>, <code>Alt-i</code>, and <code>Alt-n</code> (or <code>Alt</code> and arrow keys) move the primary <tr><td><code>W</code></td><td>WORD</td></tr>
selection according to the selection's place in the syntax tree. Let's walk <tr><td><code>p</code></td><td>Paragraph</td></tr>
through an example to get familiar with them. Many languages have a syntax like <tr><td><code>(</code>, <code>[</code>, <code>'</code>, etc.</td><td>Specified surround pairs</td></tr>
so for function calls:</p> <tr><td><code>m</code></td><td>The closest surround pair</td></tr>
<pre><code>func(arg1, arg2, arg3) <tr><td><code>f</code></td><td>Function</td></tr>
<tr><td><code>c</code></td><td>Class</td></tr>
<tr><td><code>a</code></td><td>Argument/parameter</td></tr>
<tr><td><code>o</code></td><td>Comment</td></tr>
<tr><td><code>t</code></td><td>Test</td></tr>
<tr><td><code>g</code></td><td>Change</td></tr>
</tbody></table>
</div>
<blockquote>
<p>💡 <code>f</code>, <code>c</code>, etc. need a tree-sitter grammar active for the current
document and a special tree-sitter query file to work properly. <a href="./lang-support.html">Only
some grammars</a> currently have the query file implemented.
Contributions are welcome!</p>
</blockquote>
<h2 id="navigating-using-tree-sitter-textobjects"><a class="header" href="#navigating-using-tree-sitter-textobjects">Navigating using tree-sitter textobjects</a></h2>
<p>Navigating between functions, classes, parameters, and other elements is
possible using tree-sitter and textobject queries. For
example to move to the next function use <code>]f</code>, to move to previous
class use <code>[c</code>, and so on.</p>
<p><img src="https://user-images.githubusercontent.com/23398472/152332550-7dfff043-36a2-4aec-b8f2-77c13eb56d6f.gif" alt="Tree-sitter-nav-demo" /></p>
<p>For the full reference see the <a href="./keymap.html#unimpaired">unimpaired</a> section of the key bind
documentation.</p>
<blockquote>
<p>💡 This feature relies on tree-sitter textobjects
and requires the corresponding query file to work properly.</p>
</blockquote>
<h2 id="moving-the-selection-with-syntax-aware-motions"><a class="header" href="#moving-the-selection-with-syntax-aware-motions">Moving the selection with syntax-aware motions</a></h2>
<p><code>Alt-p</code>, <code>Alt-o</code>, <code>Alt-i</code>, and <code>Alt-n</code> (or <code>Alt</code> and arrow keys) allow you to move the
selection according to its location in the syntax tree. For example, many languages have the
following syntax for function calls:</p>
<pre><code class="language-js">func(arg1, arg2, arg3);
</code></pre> </code></pre>
<p>A function call might be parsed by tree-sitter into a tree like the following.</p> <p>A function call might be parsed by tree-sitter into a tree like the following.</p>
<pre><code class="language-tsq">(call <pre><code class="language-tsq">(call
@ -224,63 +290,23 @@ a more intuitive tree format:</p>
&quot;arg1&quot; │ │ &quot;arg2&quot; │ │ &quot;arg3&quot; &quot;arg1&quot; │ │ &quot;arg2&quot; │ │ &quot;arg3&quot;
└──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘
</code></pre> </code></pre>
<p>Say we have a selection that wraps <code>arg1</code>. The selection is on the <code>arg1</code> leaf <p>If you have a selection that wraps <code>arg1</code> (see the tree above), and you use
in the tree above.</p> <code>Alt-n</code>, it will select the next sibling in the syntax tree: <code>arg2</code>.</p>
<pre><code>func([arg1], arg2, arg3) <pre><code class="language-js">// before
</code></pre> func([arg1], arg2, arg3)
<p>Using <code>Alt-n</code> would select the next sibling in the syntax tree: <code>arg2</code>.</p> // after
<pre><code>func(arg1, [arg2], arg3) func(arg1, [arg2], arg3);
</code></pre> </code></pre>
<p>While <code>Alt-o</code> would expand the selection to the parent node. In the tree above we <p>Similarly, <code>Alt-o</code> will expand the selection to the parent node, in this case, the
can see that we would select the <code>arguments</code> node.</p> arguments node.</p>
<pre><code>func[(arg1, arg2, arg3)] <pre><code class="language-js">func[(arg1, arg2, arg3)];
</code></pre> </code></pre>
<p>There is also some nuanced behavior that prevents you from getting stuck on a <p>There is also some nuanced behavior that prevents you from getting stuck on a
node with no sibling. If we have a selection on <code>arg1</code>, <code>Alt-p</code> would bring us node with no sibling. When using <code>Alt-p</code> with a selection on <code>arg1</code>, the previous
to the previous child node. Since <code>arg1</code> doesn't have a sibling to its left, child node will be selected. In the event that <code>arg1</code> does not have a previous
though, we climb the syntax tree and then take the previous selection. So sibling, the selection will move up the syntax tree and select the previous
<code>Alt-p</code> will move the selection over to the &quot;func&quot; <code>identifier</code>.</p> element. As a result, using <code>Alt-p</code> with a selection on <code>arg1</code> will move the
<pre><code>[func](arg1, arg2, arg3) selection to the &quot;func&quot; <code>identifier</code>.</p>
</code></pre>
<h2 id="textobjects"><a class="header" href="#textobjects">Textobjects</a></h2>
<p><img src="https://user-images.githubusercontent.com/23398472/124231131-81a4bb00-db2d-11eb-9d10-8e577ca7b177.gif" alt="textobject-demo" />
<img src="https://user-images.githubusercontent.com/23398472/132537398-2a2e0a54-582b-44ab-a77f-eb818942203d.gif" alt="textobject-treesitter-demo" /></p>
<ul>
<li><code>ma</code> - Select around the object (<code>va</code> in Vim, <code>&lt;alt-a&gt;</code> in Kakoune)</li>
<li><code>mi</code> - Select inside the object (<code>vi</code> in Vim, <code>&lt;alt-i&gt;</code> in Kakoune)</li>
</ul>
<div class="table-wrapper"><table><thead><tr><th>Key after <code>mi</code> or <code>ma</code></th><th>Textobject selected</th></tr></thead><tbody>
<tr><td><code>w</code></td><td>Word</td></tr>
<tr><td><code>W</code></td><td>WORD</td></tr>
<tr><td><code>p</code></td><td>Paragraph</td></tr>
<tr><td><code>(</code>, <code>[</code>, <code>'</code>, etc</td><td>Specified surround pairs</td></tr>
<tr><td><code>m</code></td><td>Closest surround pair</td></tr>
<tr><td><code>f</code></td><td>Function</td></tr>
<tr><td><code>c</code></td><td>Class</td></tr>
<tr><td><code>a</code></td><td>Argument/parameter</td></tr>
<tr><td><code>o</code></td><td>Comment</td></tr>
<tr><td><code>t</code></td><td>Test</td></tr>
<tr><td><code>g</code></td><td>Change</td></tr>
</tbody></table>
</div>
<blockquote>
<p>NOTE: <code>f</code>, <code>c</code>, etc need a tree-sitter grammar active for the current
document and a special tree-sitter query file to work properly. <a href="./lang-support.html">Only
some grammars</a> currently have the query file implemented.
Contributions are welcome!</p>
</blockquote>
<h2 id="tree-sitter-textobject-based-navigation"><a class="header" href="#tree-sitter-textobject-based-navigation">Tree-sitter Textobject Based Navigation</a></h2>
<p>Navigating between functions, classes, parameters, etc is made
possible by leveraging tree-sitter and textobjects queries. For
example to move to the next function use <code>]f</code>, to move to previous
class use <code>[c</code>, and so on.</p>
<p><img src="https://user-images.githubusercontent.com/23398472/152332550-7dfff043-36a2-4aec-b8f2-77c13eb56d6f.gif" alt="tree-sitter-nav-demo" /></p>
<p>See the <a href="./keymap.html#unimpaired">unimpaired</a> section of the keybind
documentation for the full reference.</p>
<blockquote>
<p>NOTE: This feature is dependent on tree-sitter based textobjects
and therefore requires the corresponding query file to work properly.</p>
</blockquote>
</main> </main>

Loading…
Cancel
Save