Adding new languages to Helix
+Adding new languages to Helix
In order to add a new language to Helix, you will need to follow the steps below.
Language configuration
diff --git a/master/guides/indent.html b/master/guides/indent.html index ba532e902..47c24bcc6 100644 --- a/master/guides/indent.html +++ b/master/guides/indent.html @@ -179,7 +179,7 @@Adding indent queries
+Adding indent queries
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 (see
diff --git a/master/guides/injection.html b/master/guides/injection.html
index e277c0eb5..c1dfc183d 100644
--- a/master/guides/injection.html
+++ b/master/guides/injection.html
@@ -179,7 +179,7 @@
Adding Injection Queries
+Adding Injection Queries
Writing language injection queries allows one to highlight a specific node as a different language. In addition to the standard language injection options used by tree-sitter, there are a few Helix specific extensions that allow for more control.
diff --git a/master/guides/textobject.html b/master/guides/textobject.html index 38888c4ad..3bba9ebdf 100644 --- a/master/guides/textobject.html +++ b/master/guides/textobject.html @@ -179,7 +179,7 @@Adding textobject queries
+Adding textobject queries
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
diff --git a/master/lang-support.html b/master/lang-support.html
index 5bd400810..d19f15a4c 100644
--- a/master/lang-support.html
+++ b/master/lang-support.html
@@ -179,7 +179,7 @@
Language Support
+Language Support
The following languages and Language Servers are supported. To use Language Server features, you must first configure the appropriate Language Server.
diff --git a/master/languages.html b/master/languages.html index 4a2d41c8e..918719427 100644 --- a/master/languages.html +++ b/master/languages.html @@ -179,7 +179,7 @@Languages
+Languages
Language-specific settings and settings for language servers are configured
in languages.toml
files.
languages.toml
files
diff --git a/master/print.html b/master/print.html
index 819e81c90..15860d71a 100644
--- a/master/print.html
+++ b/master/print.html
@@ -1147,7 +1147,7 @@ you to selectively add search terms to your selections.
:yank-diagnostic
:read
, :r
Language Support
+Language Support
The following languages and Language Servers are supported. To use Language Server features, you must first configure the appropriate Language Server.
@@ -1774,7 +1774,7 @@ S-tab = "extend_parent_node_start" [editor.inline-diagnostics] cursor-line = "warning" # show warnings and errors on the cursorline inline -Themes
+Themes
To use a theme add theme = "<name>"
to the top of your config.toml
file, or select it during runtime using :theme <name>
.
Creating a theme
Create a file with the name of your theme as the file name (i.e mytheme.toml
) and place it in your themes
directory (i.e ~/.config/helix/themes
or %AppData%\helix\themes
on Windows). The directory might have to be created beforehand.
diagnostic.unnecessary
diagnostic.deprecated
Key remapping
+Key remapping
Helix currently supports one-way key remapping through a simple TOML configuration file. (More powerful solutions such as rebinding via commands will be available in the future).
@@ -2249,7 +2249,7 @@ t = ":run-shell-command cargo test"Keys can be disabled by binding them to the no_op
command.
A list of commands is available in the Keymap documentation
and in the source code at helix-term/src/commands.rs
at the invocation of static_commands!
macro and the TypableCommandList
.
Languages
+Languages
Language-specific settings and settings for language servers are configured
in languages.toml
files.
languages.toml
files
@@ -2451,7 +2451,7 @@ use-grammars = { except = [ "yaml", "json" ] }
Guides
This section contains guides for adding new language server configurations, tree-sitter grammars, textobject queries, and other similar items.
-Adding new languages to Helix
+Adding new languages to Helix
In order to add a new language to Helix, you will need to follow the steps below.
Language configuration
@@ -2507,7 +2507,7 @@ grammars. remove the compiled parser located atruntime/grammars/<name>.so
.
HELIX_RUNTIME
is set to the location of the runtime
folder you're developing in.Adding textobject queries
+Adding textobject queries
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
@@ -2546,7 +2546,7 @@ following order:
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.
-Adding indent queries
+Adding indent queries
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 (see
@@ -2876,7 +2876,7 @@ 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.)
Adding Injection Queries
+Adding Injection Queries
Writing language injection queries allows one to highlight a specific node as a different language. In addition to the standard language injection options used by tree-sitter, there are a few Helix specific extensions that allow for more control.
diff --git a/master/remapping.html b/master/remapping.html index 0b866f507..5a7f9565c 100644 --- a/master/remapping.html +++ b/master/remapping.html @@ -179,7 +179,7 @@Key remapping
+Key remapping
Helix currently supports one-way key remapping through a simple TOML configuration file. (More powerful solutions such as rebinding via commands will be available in the future).
diff --git a/master/themes.html b/master/themes.html index 32fa50db0..fa68ef6f5 100644 --- a/master/themes.html +++ b/master/themes.html @@ -179,7 +179,7 @@Themes
+Themes
To use a theme add theme = "<name>"
to the top of your config.toml
file, or select it during runtime using :theme <name>
.
Creating a theme
Create a file with the name of your theme as the file name (i.e mytheme.toml
) and place it in your themes
directory (i.e ~/.config/helix/themes
or %AppData%\helix\themes
on Windows). The directory might have to be created beforehand.