Document not found (404)
-This URL is invalid, sorry. Please use the navigation bar or search to continue.
- -diff --git a/commands.html b/commands.html index 56195af9a..17acdae3d 100644 --- a/commands.html +++ b/commands.html @@ -199,7 +199,7 @@
:write-buffer-close!
, :wbc!
:new
, :n
:format
, :fmt
:indent-style
:indent-style
:line-ending
:earlier
, :ear
:later
, :lat
:reset-diff-change
, :diffget
, :diffg
:clear-register
:redraw
:move
:yank-diagnostic
๐ก You can easily open the config file by typing :config-open
within Helix normal mode.
Example config:
-theme = "onedark"
+theme = "onedark"
[editor]
-line-number = "relative"
+line-number = "relative"
mouse = false
[editor.cursor-shape]
-insert = "bar"
-normal = "block"
-select = "underline"
+insert = "bar"
+normal = "block"
+select = "underline"
[editor.file-picker]
hidden = false
@@ -216,15 +216,16 @@ Its settings will be merged with the configuration directory config.toml
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"]
+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"]
+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
+idle-timeout
Time in milliseconds since last keypress before idle timers trigger. 250
+completion-timeout
Time in milliseconds after typing a word character before completions are shown, set to 5 for instant. 250
preview-completion-insert
Whether to apply completion item instantly when selected true
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
@@ -238,31 +239,34 @@ Its settings will be merged with the configuration directory config.toml
workspace-lsp-roots
Directories relative to the workspace root that are treated as LSP roots. Should only be set in .helix/config.toml
[]
default-line-ending
The line ending to use for new documents. Can be native
, lf
, crlf
, ff
, cr
or nel
. native
uses the platform's native line ending (crlf
on Windows, otherwise lf
). native
insert-final-newline
Whether to automatically insert a trailing line-ending on write if missing true
+popup-border
Draw border around popup
, menu
, all
, or none
none
+indent-heuristic
How the indentation for a newly inserted line is computed: simple
just copies the indentation level from the previous line, tree-sitter
computes the indentation based on the syntax tree and hybrid
combines both approaches. If the chosen heuristic is not available, a different one will be used as a fallback (the fallback order being hybrid
-> tree-sitter
-> simple
). hybrid
+jump-label-alphabet
The characters that are used to generate two character jump labels. Characters at the start of the alphabet are used first. "abcdefghijklmnopqrstuvwxyz"
[editor.statusline]
Section
Allows configuring the statusline at the bottom of the editor.
The configuration distinguishes between three areas of the status line:
-[ ... ... LEFT ... ... | ... ... ... ... CENTER ... ... ... ... | ... ... RIGHT ... ... ]
+[ ... ... 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"
+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", "read-only-indicator", "file-modification-indicator"]
+left
A list of elements aligned to the left of the statusline ["mode", "spinner", "file-name", "read-only-indicator", "file-modification-indicator"]
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", "register", "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"
+right
A list of elements aligned to the right of the statusline ["diagnostics", "selections", "register", "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:
@@ -270,6 +274,7 @@ mode.select = "SELECT"
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-absolute-path
The absolute 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
@@ -283,7 +288,7 @@ mode.select = "SELECT"
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 "โ"
)
+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
register
The current selected register
@@ -324,17 +329,29 @@ change shape.
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-symlinks
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
.
+hidden
Enables ignoring hidden files true
+follow-symlinks
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.excludesfile
option true
+git-exclude
Enables reading .git/info/exclude
files true
+max-depth
Set with an integer value for maximum depth to recurse Unset by default
+Ignore files can be placed locally as .ignore
or put in your home directory as ~/.ignore
. They support the usual ignore and negative ignore (unignore) rules used in .gitignore
files.
+Additionally, you can use Helix-specific ignore files by creating a local .helix/ignore
file in the current workspace or a global ignore
file located in your Helix config directory:
+
+- Linux and Mac:
~/.config/helix/ignore
+- Windows:
%AppData%\helix\ignore
+
+Example:
+# unignore in file picker and global search
+!.github/
+!.gitignore
+!.gitattributes
+
[editor.auto-pairs]
Section
Enables automatic insertion of pairs to parentheses, brackets, etc. Can be a
simple boolean value, or a specific mapping of pairs of single characters.
@@ -342,28 +359,28 @@ simple boolean value, or a specific mapping of pairs of single characters.
[editor]
auto-pairs = false # defaults to `true`
-The default pairs are (){}[]''""``
, but these can be customized by
+
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 ''
+Example languages.toml
that adds <>
and removes ''
[[language]]
-name = "rust"
+name = "rust"
[language.auto-pairs]
'(' = ')'
'{' = '}'
'[' = ']'
-'"' = '"'
+'"' = '"'
'`' = '`'
'<' = '>'
@@ -377,25 +394,28 @@ name = "rust"
[editor.whitespace]
Section
Options 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
+render
Whether to render whitespace. May either be all
or none
, or a table with sub-keys space
, nbsp
, nnbsp
, tab
, and newline
none
+characters
Literal characters to use when rendering whitespace. Sub-keys may be any of tab
, space
, nbsp
, nnbsp
, newline
or tabpad
See example below
Example
[editor.whitespace]
-render = "all"
+render = "all"
# or control each character
[editor.whitespace.render]
-space = "all"
-tab = "all"
-newline = "none"
+space = "all"
+tab = "all"
+nbsp = "none"
+nnbsp = "none"
+newline = "none"
[editor.whitespace.characters]
-space = "ยท"
-nbsp = "โฝ"
-tab = "โ"
-newline = "โ"
-tabpad = "ยท" # Tabs will look like "โยทยทยท" (depending on tab width)
+space = "ยท"
+nbsp = "โฝ"
+nnbsp = "โฃ"
+tab = "โ"
+newline = "โ"
+tabpad = "ยท" # Tabs will look like "โยทยทยท" (depending on tab width)
[editor.indent-guides]
Section
Options for rendering vertical indent guides.
@@ -408,25 +428,25 @@ tabpad = "ยท" # Tabs will look like "โยทยทยท" (depending o
Example:
[editor.indent-guides]
render = true
-character = "โ" # Some characters that work well: "โ", "โ", "โ", "โธฝ"
+character = "โ" # Some characters that work well: "โ", "โ", "โ", "โธฝ"
skip-levels = 1
[editor.gutters]
Section
For 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"]
+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"]
+layout
A vector of gutters to display ["diagnostics", "spacer", "line-numbers", "spacer", "diff"]
Example:
[editor.gutters]
-layout = ["diff", "diagnostics", "line-numbers", "spacer"]
+layout = ["diff", "diagnostics", "line-numbers", "spacer"]
[editor.gutters.line-numbers]
Section
Options for the line number gutter
@@ -441,7 +461,10 @@ min-width = 1
[editor.gutters.diagnostics]
Section
Currently unused
[editor.gutters.diff]
Section
-Currently unused
+The diff
gutter option displays colored bars indicating whether a git
diff represents that a line was added, removed or changed.
+These colors are controlled by the theme attributes diff.plus
, diff.minus
and diff.delta
.
+Other diff providers will eventually be supported by a future plugin system.
+There are currently no options for this section.
[editor.gutters.spacer]
Section
Currently unused
[editor.soft-wrap]
Section
@@ -459,14 +482,28 @@ min-width = 1
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
+wrap-indicator = "" # set wrap-indicator to "" to hide it
[editor.smart-tab]
Section
+Options for navigating and editing using tab key.
Key Description Default
enable
If set to true, then when the cursor is in a position with non-whitespace to its left, instead of inserting a tab, it will run move_parent_node_end
. If there is only whitespace to the left, then it inserts a tab as normal. With the default bindings, to explicitly insert a tab character, press Shift-tab. true
supersede-menu
Normally, when a menu is on screen, such as when auto complete is triggered, the tab key is bound to cycling through the items. This means when menus are on screen, one cannot use the tab key to trigger the smart-tab
command. If this option is set to true, the smart-tab
command always takes precedence, which means one cannot use the tab key to cycle through menu items. One of the other bindings must be used instead, such as arrow keys or C-n
/C-p
. false
+Due to lack of support for S-tab in some terminals, the default keybindings don't fully embrace smart-tab editing experience. If you enjoy smart-tab navigation and a terminal that supports the Enhanced Keyboard protocol, consider setting extra keybindings:
+[keys.normal]
+tab = "move_parent_node_end"
+S-tab = "move_parent_node_start"
+
+[keys.insert]
+S-tab = "move_parent_node_start"
+
+[keys.select]
+tab = "extend_parent_node_end"
+S-tab = "extend_parent_node_start"
+
+
((block) @indent)
-["}" ")"] @outdent
+["}" ")"] @outdent
Note how on the second line, we have two blocks begin on the same line. In this case, since both captures occur on the same line, they are combined and only @@ -323,7 +331,7 @@ whitespace-sensitive.
the cursor on a line feed ends up being the entire inside of the class. Because of this, it will miss the entire function node and its indent capture, leading to an indent level one too small. -To address this case, @extend
tells helix to "extend" the captured node's span
+
To address this case, @extend
tells helix to "extend" the captured node's span
to the line feed and every consecutive line that has a greater indent level than
the line of the node.
(parenthesized_expression) @indent
@@ -431,7 +439,7 @@ similar to how #set!
declarations work:
)
The number of arguments depends on the predicate that's used.
-Each argument is either a capture (@name
) or a string ("some string"
).
+Each argument is either a capture (@name
) or a string ("some string"
).
The following predicates are supported by tree-sitter:
#any-of?
/#not-any-of?
:
+The first argument (a capture) must/must not be one of the other arguments
+(strings).
Additionally, we support some custom predicates for indent queries:
#![allow(unused)] fn main() { fn aha() { // โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ - let take = "on me"; // โโโโโโโโโโโโโโโโฎ scope: โ - let take = "me on"; // โโ "tail" โโ (block) @indent + let take = "on me"; // โโโโโโโโโโโโโโโโฎ scope: โ + let take = "me on"; // โโ "tail" โโ (block) @indent let ill = be_gone_days(1 || 2); // โ โ -} // โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโดโ "}" @outdent - // scope: "all" +} // โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโดโ "}" @outdent + // scope: "all" }
We can write the following query with the #set!
declaration:
((block) @indent
- (#set! "scope" "tail"))
-("}" @outdent
- (#set! "scope" "all"))
+ (#set! "scope" "tail"))
+("}" @outdent
+ (#set! "scope" "all"))
-As we can see, the "tail" scope covers the node, except for the first line. +
As we can see, the "tail" scope covers the node, except for the first line.
Everything up to and including the closing brace gets an indent level of 1.
-Then, on the closing brace, we encounter an outdent with a scope of "all", which
+Then, on the closing brace, we encounter an outdent with a scope of "all", which
means the first line is included, and the indent level is cancelled out on this
line. (Note these scopes are the defaults for @indent
and @outdent
โthey are
written explicitly for demonstration.)
#any-of?
(standard):
+The first argument (a capture) must be one of the other arguments (strings).
comment.around
Example query files can be found in the helix GitHub repository.
+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:
diff --git a/highlight.js b/highlight.js index 180385b70..3256c00ed 100644 --- a/highlight.js +++ b/highlight.js @@ -3,4 +3,51 @@ License: BSD-3-Clause Copyright (c) 2006-2020, Ivan Sagalaev */ -var hljs=function(){"use strict";function e(n){Object.freeze(n);var t="function"==typeof n;return Object.getOwnPropertyNames(n).forEach((function(r){!Object.hasOwnProperty.call(n,r)||null===n[r]||"object"!=typeof n[r]&&"function"!=typeof n[r]||t&&("caller"===r||"callee"===r||"arguments"===r)||Object.isFrozen(n[r])||e(n[r])})),n}class n{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}ignoreMatch(){this.ignore=!0}}function t(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function r(e,...n){var t={};for(const n in e)t[n]=e[n];return n.forEach((function(e){for(const n in e)t[n]=e[n]})),t}function a(e){return e.nodeName.toLowerCase()}var i=Object.freeze({__proto__:null,escapeHTML:t,inherit:r,nodeStream:function(e){var n=[];return function e(t,r){for(var i=t.firstChild;i;i=i.nextSibling)3===i.nodeType?r+=i.nodeValue.length:1===i.nodeType&&(n.push({event:"start",offset:r,node:i}),r=e(i,r),a(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:r,node:i}));return r}(e,0),n},mergeStreams:function(e,n,r){var i=0,s="",o=[];function l(){return e.length&&n.length?e[0].offset!==n[0].offset?e[0].offsetThis URL is invalid, sorry. Please use the navigation bar or search to continue.
- -