Document not found (404)
+This URL is invalid, sorry. Please use the navigation bar or search to continue.
+ +diff --git a/master/.nojekyll b/master/.nojekyll new file mode 100644 index 000000000..f17311098 --- /dev/null +++ b/master/.nojekyll @@ -0,0 +1 @@ +This file makes sure that Github Pages doesn't process mdBook's output. diff --git a/master/404.html b/master/404.html new file mode 100644 index 000000000..858090cc1 --- /dev/null +++ b/master/404.html @@ -0,0 +1,191 @@ + + +
+ + +This URL is invalid, sorry. Please use the navigation bar or search to continue.
+ +Command mode can be activated by pressing :
. The built-in commands are:
Name | Description |
---|---|
:quit , :q | Close the current view. |
:quit! , :q! | Force close the current view, ignoring unsaved changes. |
:open , :o | Open a file from disk into the current view. |
:buffer-close , :bc , :bclose | Close the current buffer. |
:buffer-close! , :bc! , :bclose! | Close the current buffer forcefully, ignoring unsaved changes. |
:buffer-close-others , :bco , :bcloseother | Close all buffers but the currently focused one. |
:buffer-close-others! , :bco! , :bcloseother! | Force close all buffers but the currently focused one. |
:buffer-close-all , :bca , :bcloseall | Close all buffers without quitting. |
:buffer-close-all! , :bca! , :bcloseall! | Force close all buffers ignoring unsaved changes without quitting. |
:buffer-next , :bn , :bnext | Goto next buffer. |
:buffer-previous , :bp , :bprev | Goto previous buffer. |
:write , :w | Write changes to disk. Accepts an optional path (:write some/path.txt) |
:write! , :w! | Force write changes to disk creating necessary subdirectories. Accepts an optional path (:write some/path.txt) |
:new , :n | Create a new scratch buffer. |
:format , :fmt | Format the file using the LSP formatter. |
:indent-style | Set the indentation style for editing. ('t' for tabs or 1-8 for number of spaces.) |
:line-ending | Set the document's default line ending. Options: crlf, lf. |
:earlier , :ear | Jump back to an earlier point in edit history. Accepts a number of steps or a time span. |
:later , :lat | Jump to a later point in edit history. Accepts a number of steps or a time span. |
:write-quit , :wq , :x | Write changes to disk and close the current view. Accepts an optional path (:wq some/path.txt) |
:write-quit! , :wq! , :x! | Write changes to disk and close the current view forcefully. Accepts an optional path (:wq! some/path.txt) |
:write-all , :wa | Write changes from all buffers to disk. |
:write-quit-all , :wqa , :xa | Write changes from all buffers to disk and close all views. |
:write-quit-all! , :wqa! , :xa! | Write changes from all buffers to disk and close all views forcefully (ignoring unsaved changes). |
:quit-all , :qa | Close all views. |
:quit-all! , :qa! | Force close all views ignoring unsaved changes. |
:cquit , :cq | Quit with exit code (default 1). Accepts an optional integer exit code (:cq 2). |
:cquit! , :cq! | Force quit with exit code (default 1) ignoring unsaved changes. Accepts an optional integer exit code (:cq! 2). |
:theme | Change the editor theme (show current theme if no name specified). |
:clipboard-yank | Yank main selection into system clipboard. |
:clipboard-yank-join | Yank joined selections into system clipboard. A separator can be provided as first argument. Default value is newline. |
:primary-clipboard-yank | Yank main selection into system primary clipboard. |
:primary-clipboard-yank-join | Yank joined selections into system primary clipboard. A separator can be provided as first argument. Default value is newline. |
:clipboard-paste-after | Paste system clipboard after selections. |
:clipboard-paste-before | Paste system clipboard before selections. |
:clipboard-paste-replace | Replace selections with content of system clipboard. |
:primary-clipboard-paste-after | Paste primary clipboard after selections. |
:primary-clipboard-paste-before | Paste primary clipboard before selections. |
:primary-clipboard-paste-replace | Replace selections with content of system primary clipboard. |
:show-clipboard-provider | Show clipboard provider name in status bar. |
:change-current-directory , :cd | Change the current working directory. |
:show-directory , :pwd | Show the current working directory. |
:encoding | Set encoding. Based on https://encoding.spec.whatwg.org . |
:character-info , :char | Get info about the character under the primary cursor. |
:reload | Discard changes and reload from the source file. |
:reload-all | Discard changes and reload all documents from the source files. |
:update | Write changes only if the file has been modified. |
:lsp-workspace-command | Open workspace command picker |
:lsp-restart | Restarts the Language Server that is in use by the current doc |
:lsp-stop | Stops the Language Server that is in use by the current doc |
:tree-sitter-scopes | Display tree sitter scopes, primarily for theming and development. |
:debug-start , :dbg | Start a debug session from a given template with given parameters. |
:debug-remote , :dbg-tcp | Connect to a debug adapter by TCP address and start a debugging session from a given template with given parameters. |
:debug-eval | Evaluate expression in current debug context. |
:vsplit , :vs | Open the file in a vertical split. |
:vsplit-new , :vnew | Open a scratch buffer in a vertical split. |
:hsplit , :hs , :sp | Open the file in a horizontal split. |
:hsplit-new , :hnew | Open a scratch buffer in a horizontal split. |
:tutor | Open the tutorial. |
:goto , :g | Goto line number. |
:set-language , :lang | Set the language of current buffer (show current language if no value specified). |
:set-option , :set | Set a config option at runtime. For example to disable smart case search, use :set search.smart-case false . |
:toggle-option , :toggle | Toggle a boolean config option at runtime. For example to toggle smart case search, use :toggle search.smart-case . |
:get-option , :get | Get the current value of a config option. |
:sort | Sort ranges in selection. |
:rsort | Sort ranges in selection in reverse order. |
:reflow | Hard-wrap the current selection of lines to a given width. |
:tree-sitter-subtree , :ts-subtree | Display tree sitter subtree under cursor, primarily for debugging queries. |
:config-reload | Refresh user config. |
:config-open | Open the user config.toml file. |
:config-open-workspace | Open the workspace config.toml file. |
:log-open | Open the helix log file. |
:insert-output | Run shell command, inserting output before each selection. |
:append-output | Run shell command, appending output after each selection. |
:pipe | Pipe each selection to the shell command. |
:pipe-to | Pipe each selection to the shell command, ignoring output. |
:run-shell-command , :sh | Run a shell command |
:reset-diff-change , :diffget , :diffg | Reset the diff change at the cursor position. |
To override global configuration parameters, create a config.toml
file located in your config directory:
~/.config/helix/config.toml
%AppData%\helix\config.toml
++💡 You can easily open the config file by typing
+:config-open
within Helix normal mode.
Example config:
+theme = "onedark"
+
+[editor]
+line-number = "relative"
+mouse = false
+
+[editor.cursor-shape]
+insert = "bar"
+normal = "block"
+select = "underline"
+
+[editor.file-picker]
+hidden = false
+
+You can use a custom configuration file by specifying it with the -c
or
+--config
command line argument, for example hx -c path/to/custom-config.toml
.
+Additionally, you can reload the configuration file by sending the USR1
+signal to the Helix process on Unix operating systems, such as by using the command pkill -USR1 hx
.
Finally, you can have a config.toml
local to a project by putting it under a .helix
directory in your repository.
+Its settings will be merged with the configuration directory config.toml
and the built-in configuration.
[editor]
SectionKey | Description | Default |
---|---|---|
scrolloff | Number of lines of padding around the edge of the screen when scrolling | 5 |
mouse | Enable mouse mode | true |
middle-click-paste | Middle click paste support | true |
scroll-lines | Number of lines to scroll per scroll wheel step | 3 |
shell | Shell to use when running external commands | Unix: ["sh", "-c"] Windows: ["cmd", "/C"] |
line-number | Line number display: absolute simply shows each line's number, while relative shows the distance from the current line. When unfocused or in insert mode, relative will still show absolute line numbers | absolute |
cursorline | Highlight all lines with a cursor | false |
cursorcolumn | Highlight all columns with a cursor | false |
gutters | Gutters to display: Available are diagnostics and diff and line-numbers and spacer , note that diagnostics also includes other features like breakpoints, 1-width padding will be inserted if gutters is non-empty | ["diagnostics", "spacer", "line-numbers", "spacer", "diff"] |
auto-completion | Enable automatic pop up of auto-completion | true |
auto-format | Enable automatic formatting on save | true |
auto-save | Enable automatic saving on the focus moving away from Helix. Requires focus event support from your terminal | false |
idle-timeout | Time in milliseconds since last keypress before idle timers trigger. Used for autocompletion, set to 0 for instant | 400 |
completion-trigger-len | The min-length of word under cursor to trigger autocompletion | 2 |
completion-replace | Set to true to make completions always replace the entire word and not just the part before the cursor | false |
auto-info | Whether to display info boxes | true |
true-color | Set to true to override automatic detection of terminal truecolor support in the event of a false negative | false |
undercurl | Set to true to override automatic detection of terminal undercurl support in the event of a false negative | false |
rulers | List of column positions at which to display the rulers. Can be overridden by language specific rulers in languages.toml file | [] |
bufferline | Renders a line at the top of the editor displaying open buffers. Can be always , never or multiple (only shown if more than one buffer is in use) | never |
color-modes | Whether to color the mode indicator with different colors depending on the mode itself | false |
text-width | Maximum line length. Used for the :reflow command and soft-wrapping if soft-wrap.wrap_at_text_width is set | 80 |
workspace-lsp-roots | Directories relative to the workspace root that are treated as LSP roots. Should only be set in .helix/config.toml | [] |
[editor.statusline]
SectionAllows configuring the statusline at the bottom of the editor.
+The configuration distinguishes between three areas of the status line:
+[ ... ... LEFT ... ... | ... ... ... ... CENTER ... ... ... ... | ... ... RIGHT ... ... ]
Statusline elements can be defined as follows:
+[editor.statusline]
+left = ["mode", "spinner"]
+center = ["file-name"]
+right = ["diagnostics", "selections", "position", "file-encoding", "file-line-ending", "file-type"]
+separator = "│"
+mode.normal = "NORMAL"
+mode.insert = "INSERT"
+mode.select = "SELECT"
+
+The [editor.statusline]
key takes the following sub-keys:
Key | Description | Default |
---|---|---|
left | A list of elements aligned to the left of the statusline | ["mode", "spinner", "file-name"] |
center | A list of elements aligned to the middle of the statusline | [] |
right | A list of elements aligned to the right of the statusline | ["diagnostics", "selections", "position", "file-encoding"] |
separator | The character used to separate elements in the statusline | "│" |
mode.normal | The text shown in the mode element for normal mode | "NOR" |
mode.insert | The text shown in the mode element for insert mode | "INS" |
mode.select | The text shown in the mode element for select mode | "SEL" |
The following statusline elements can be configured:
+Key | Description |
---|---|
mode | The current editor mode (mode.normal /mode.insert /mode.select ) |
spinner | A progress spinner indicating LSP activity |
file-name | The path/name of the opened file |
file-base-name | The basename of the opened file |
file-modification-indicator | The indicator to show whether the file is modified (a [+] appears when there are unsaved changes) |
file-encoding | The encoding of the opened file if it differs from UTF-8 |
file-line-ending | The file line endings (CRLF or LF) |
total-line-numbers | The total line numbers of the opened file |
file-type | The type of the opened file |
diagnostics | The number of warnings and/or errors |
workspace-diagnostics | The number of warnings and/or errors on workspace |
selections | The number of active selections |
primary-selection-length | The number of characters currently in primary selection |
position | The cursor position |
position-percentage | The cursor position as a percentage of the total number of lines |
separator | The string defined in editor.statusline.separator (defaults to "│" ) |
spacer | Inserts a space between elements (multiple/contiguous spacers may be specified) |
version-control | The current branch name or detached commit hash of the opened workspace |
[editor.lsp]
SectionKey | Description | Default |
---|---|---|
enable | Enables LSP integration. Setting to false will completely disable language servers regardless of language settings. | true |
display-messages | Display LSP progress messages below statusline1 | false |
auto-signature-help | Enable automatic popup of signature help (parameter hints) | true |
display-inlay-hints | Display inlay hints2 | false |
display-signature-help-docs | Display docs under signature help popup | true |
snippets | Enables snippet completions. Requires a server restart (:lsp-restart ) to take effect after :config-reload /:set . | true |
By default, a progress spinner is shown in the statusline beside the file path. +2: You may also have to activate them in the LSP config for them to appear, not just in Helix. +Inlay hints in Helix are still being improved on and may be a little bit laggy/janky under some circumstances, please report any bugs you see so we can fix them!
+[editor.cursor-shape]
SectionDefines the shape of cursor in each mode.
+Valid values for these options are block
, bar
, underline
, or hidden
.
++💡 Due to limitations of the terminal environment, only the primary cursor can +change shape.
+
Key | Description | Default |
---|---|---|
normal | Cursor shape in normal mode | block |
insert | Cursor shape in insert mode | block |
select | Cursor shape in select mode | block |
[editor.file-picker]
SectionSet options for file picker and global search. Ignoring a file means it is +not visible in the Helix file picker and global search.
+All git related options are only enabled in a git repository.
+Key | Description | Default |
---|---|---|
hidden | Enables ignoring hidden files | true |
follow-links | Follow symlinks instead of ignoring them | true |
deduplicate-links | Ignore symlinks that point at files already shown in the picker | true |
parents | Enables reading ignore files from parent directories | true |
ignore | Enables reading .ignore files | true |
git-ignore | Enables reading .gitignore files | true |
git-global | Enables reading global .gitignore , whose path is specified in git's config: core.excludefile option | true |
git-exclude | Enables reading .git/info/exclude files | true |
max-depth | Set with an integer value for maximum depth to recurse | Defaults to None . |
[editor.auto-pairs]
SectionEnables automatic insertion of pairs to parentheses, brackets, etc. Can be a +simple boolean value, or a specific mapping of pairs of single characters.
+To disable auto-pairs altogether, set auto-pairs
to false
:
[editor]
+auto-pairs = false # defaults to `true`
+
+The default pairs are (){}[]''""``
, but these can be customized by
+setting auto-pairs
to a TOML table:
[editor.auto-pairs]
+'(' = ')'
+'{' = '}'
+'[' = ']'
+'"' = '"'
+'`' = '`'
+'<' = '>'
+
+Additionally, this setting can be used in a language config. Unless
+the editor setting is false
, this will override the editor config in
+documents with this language.
Example languages.toml
that adds <> and removes ''
[[language]]
+name = "rust"
+
+[language.auto-pairs]
+'(' = ')'
+'{' = '}'
+'[' = ']'
+'"' = '"'
+'`' = '`'
+'<' = '>'
+
+[editor.search]
SectionSearch specific options.
+Key | Description | Default |
---|---|---|
smart-case | Enable smart case regex searching (case-insensitive unless pattern contains upper case characters) | true |
wrap-around | Whether the search should wrap after depleting the matches | true |
[editor.whitespace]
SectionOptions for rendering whitespace with visible characters. Use :set whitespace.render all
to temporarily enable visible whitespace.
Key | Description | Default |
---|---|---|
render | Whether to render whitespace. May either be "all" or "none" , or a table with sub-keys space , nbsp , tab , and newline | "none" |
characters | Literal characters to use when rendering whitespace. Sub-keys may be any of tab , space , nbsp , newline or tabpad | See example below |
Example
+[editor.whitespace]
+render = "all"
+# or control each character
+[editor.whitespace.render]
+space = "all"
+tab = "all"
+newline = "none"
+
+[editor.whitespace.characters]
+space = "·"
+nbsp = "⍽"
+tab = "→"
+newline = "⏎"
+tabpad = "·" # Tabs will look like "→···" (depending on tab width)
+
+[editor.indent-guides]
SectionOptions for rendering vertical indent guides.
+Key | Description | Default |
---|---|---|
render | Whether to render indent guides | false |
character | Literal character to use for rendering the indent guide | │ |
skip-levels | Number of indent levels to skip | 0 |
Example:
+[editor.indent-guides]
+render = true
+character = "╎" # Some characters that work well: "▏", "┆", "┊", "⸽"
+skip-levels = 1
+
+[editor.gutters]
SectionFor simplicity, editor.gutters
accepts an array of gutter types, which will
+use default settings for all gutter components.
[editor]
+gutters = ["diff", "diagnostics", "line-numbers", "spacer"]
+
+To customize the behavior of gutters, the [editor.gutters]
section must
+be used. This section contains top level settings, as well as settings for
+specific gutter components as subsections.
Key | Description | Default |
---|---|---|
layout | A vector of gutters to display | ["diagnostics", "spacer", "line-numbers", "spacer", "diff"] |
Example:
+[editor.gutters]
+layout = ["diff", "diagnostics", "line-numbers", "spacer"]
+
+[editor.gutters.line-numbers]
SectionOptions for the line number gutter
+Key | Description | Default |
---|---|---|
min-width | The minimum number of characters to use | 3 |
Example:
+[editor.gutters.line-numbers]
+min-width = 1
+
+[editor.gutters.diagnostics]
SectionCurrently unused
+[editor.gutters.diff]
SectionCurrently unused
+[editor.gutters.spacer]
SectionCurrently unused
+[editor.soft-wrap]
SectionOptions for soft wrapping lines that exceed the view width:
+Key | Description | Default |
---|---|---|
enable | Whether soft wrapping is enabled. | false |
max-wrap | Maximum free space left at the end of the line. | 20 |
max-indent-retain | Maximum indentation to carry over when soft wrapping a line. | 40 |
wrap-indicator | Text inserted before soft wrapped lines, highlighted with ui.virtual.wrap | ↪ |
wrap-at-text-width | Soft wrap at text-width instead of using the full viewport size. | false |
Example:
+[editor.soft-wrap]
+enable = true
+max-wrap = 25 # increase value to reduce forced mid-word wrapping
+max-indent-retain = 0
+wrap-indicator = "" # set wrap-indicator to "" to hide it
+
+
+ Helix's editing model is strongly inspired from Vim and Kakoune, and a notable
+difference from Vim (and the most striking similarity to Kakoune) is that Helix
+follows the selection → action
model. This means that the whatever you are
+going to act on (a word, a paragraph, a line, etc) is selected first and the
+action itself (delete, change, yank, etc) comes second. A cursor is simply a
+single width selection.
See also Kakoune's Migrating from Vim and Helix's Migrating from Vim.
+++ +TODO: Mention textobjects, surround, registers
+
In order to add a new language to Helix, you will need to follow the steps +below.
+[[language]]
entry in the languages.toml
file and provide the
+necessary configuration for the new language. For more information on
+language configuration, refer to the
+language configuration section of the documentation.cargo xtask docgen
to update the
+Language Support documentation.++💡 If you are adding a new Language Server configuration, make sure to update +the +Language Server Wiki +with the installation instructions.
+
[[grammar]]
entry to the languages.toml
file.source.path
key
+with an absolute path to the grammar. However, before submitting a pull
+request, make sure to switch to using source.git
.runtime/queries/<name>/
.++💡 In Helix, the first matching query takes precedence when evaluating +queries, which is different from other editors such as Neovim where the last +matching query supersedes the ones before it. See +this issue +for an example.
+
hx --grammar fetch
+to fetch the grammars and hx --grammar build
to build any out-of-date
+grammars.runtime/grammars/<name>.so
.Helix uses tree-sitter to correctly indent new lines. This requires
+a tree-sitter grammar and an indent.scm
query file placed in
+runtime/queries/{language}/indents.scm
. The indentation for a line
+is calculated by traversing the syntax tree from the lowest node at the
+beginning of the new line. Each of these nodes contributes to the total
+indent when it is captured by the query (in what way depends on the name
+of the capture).
Note that it matters where these added indents begin. For example, +multiple indent level increases that start on the same line only increase +the total indent level by 1.
+Added indents don't always apply to the whole node. For example, in most +cases when a node should be indented, we actually only want everything +except for its first line to be indented. For this, there are several +scopes (more scopes may be added in the future if required):
+all
:
+This scope applies to the whole captured node. This is only different from
+tail
when the captured node is the first node on its line.
tail
:
+This scope applies to everything except for the first line of the
+captured node.
Every capture type has a default scope which should do the right thing
+in most situations. When a different scope is required, this can be
+changed by using a #set!
declaration anywhere in the pattern:
(assignment_expression
+ right: (_) @indent
+ (#set! "scope" "all"))
+
+@indent
(default scope tail
):
+Increase the indent level by 1. Multiple occurrences in the same line
+don't stack. If there is at least one @indent
and one @outdent
+capture on the same line, the indent level isn't changed at all.
@outdent
(default scope all
):
+Decrease the indent level by 1. The same rules as for @indent
apply.
@extend
:
+Extend the range of this node to the end of the line and to lines that
+are indented more than the line that this node starts on. This is useful
+for languages like Python, where for the purpose of indentation some nodes
+(like functions or classes) should also contain indented lines that follow them.
@extend.prevent-once
:
+Prevents the first extension of an ancestor of this node. For example, in Python
+a return expression always ends the block that it is in. Note that this only stops the
+extension of the next @extend
capture. If multiple ancestors are captured,
+only the extension of the innermost one is prevented. All other ancestors are unaffected
+(regardless of whether the innermost ancestor would actually have been extended).
In some cases, an S-expression cannot express exactly what pattern should be matched.
+For that, tree-sitter allows for predicates to appear anywhere within a pattern,
+similar to how #set!
declarations work:
(some_kind
+ (child_kind) @indent
+ (#predicate? arg1 arg2 ...)
+)
+
+The number of arguments depends on the predicate that's used.
+Each argument is either a capture (@name
) or a string ("some string"
).
+The following predicates are supported by tree-sitter:
#eq?
/#not-eq?
:
+The first argument (a capture) must/must not be equal to the second argument
+(a capture or a string).
#match?
/#not-match?
:
+The first argument (a capture) must/must not match the regex given in the
+second argument (a string).
Additionally, we support some custom predicates for indent queries:
+#not-kind-eq?
:
+The kind of the first argument (a capture) must not be equal to the second
+argument (a string).
#same-line?
/#not-same-line?
:
+The captures given by the 2 arguments must/must not start on the same line.
This section contains guides for adding new language server configurations, +tree-sitter grammars, textobject queries, and other similar items.
+ +Helix supports textobjects that are language specific, such as functions, classes, etc.
+These textobjects require an accompanying tree-sitter grammar and a textobjects.scm
query file
+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.
+More information on how to write queries can be found in the official tree-sitter
+documentation.
Query files should be placed in runtime/queries/{language}/textobjects.scm
+when contributing to Helix. Note that to test the query files locally you should put
+them under your local runtime directory (~/.config/helix/runtime
on Linux
+for example).
The following captures are recognized:
+Capture Name |
---|
function.inside |
function.around |
class.inside |
class.around |
test.inside |
test.around |
parameter.inside |
comment.inside |
comment.around |
Example query files can be found in the helix GitHub repository.
+Tree-sitter based navigation in Helix is done using captures in the +following order:
+object.movement
object.around
object.inside
For example if a function.around
capture has been already defined for a language
+in its textobjects.scm
file, function navigation should also work automatically.
+function.movement
should be defined only if the node captured by function.around
+doesn't make sense in a navigation context.
Docs for bleeding edge master can be found at +https://docs.helix-editor.com/master.
+See the usage section for a quick overview of the editor, keymap +section for all available keybindings and the configuration section +for defining custom keybindings, setting themes, etc. +For everything else (e.g., how to install supported language servers), see the Helix Wiki.
+Refer the FAQ for common questions.
+ +