Skip to content

News

Release 22.05 Highlights

Helix is a modal text editor with built-in support for multiple selections, Language Server Protocol (LSP), tree-sitter, and experimental support for Debug Adapter Protocol (DAP).

Today marks the 22.05 release, a featureful release with over double the number of contributors as last release (110!). A big thanks to all involved! 🙌

Also a big shout out to @amirrezaask for this great Helix introduction video!

Let’s check out the flashy features of 22.05.

Indentation rework

The indentation system has been fully reworked. Indentation still works by querying the parsed tree-sitter syntax tree for a document, but now query files can use the full expressive power of tree-sitter queries rather than just simple node names. Expect more robust indentation with fewer edge cases.

Configurable gutters

Gutters can now be configured in your config.toml file. For example, you can remove the line-number gutter while still showing LSP diagnostics.

[editor]
gutters = ["diagnostics"] # default is ["diagnostics", "line-numbers"]

Local language configuration

Language configuration can now be specified local to a project. Create a .helix directory and a languages.toml under it to override values from the default language configuration. For example, override a C project’s indents to use tabs instead of spaces for indentation:

my_c_project/.helix/languages.toml
[[language]]
name = "c"
indent = { tab-width = 8, unit = "\t" }

Rulers

Vertical rulers may now be configured through the rulers option. Use them as a guide when adhering to a maximum line length.

Show visible whitespace

Whitespace characters like spaces, tabs, and newlines may now be rendered. Use the whitespace.render option either at runtime with the :set command or in your config.toml under the editor section. Visible whitespace indicators can make Helix’s selection model more intuitive, especially around line endings. The characters used for tabs, spaces, non-breaking space, and newlines may also be customized as well as whether any of the characters are rendered at all. In fact, for the remaining asciicasts in this post, you’ll be seeing my custom tab and newline characters!

Use registers in prompts

Values stored in registers may now be used in prompts like search or global search. In the above example, we yank a selection to the " register with y and then open up the global search prompt with Space /. The available registers are shown above the prompt and we hit " to insert the contents of the " register.

Reflow paragraphs

The new :reflow command hard-wraps text to a given column width. Default column widths may be configured on a per-language basis. Reflow recognizes matching prefixes between lines, so you may reflow line-comments, markdown quotes or lines with leading whitespace and the leading characters will be placed appropriately.

Swap windows

Windows may now be swapped with neighbor windows and splits may be transposed. With the window menu open (C-w or space w), use H, J, K, and L to swap the current window with the left, down, up, and right neighbors, respectively. Use t or C-t to switch between a vertical and horizontal split or vice versa.

Set a language at runtime

The language for a buffer may now be set at runtime. Use :set-language language (or :lang language for short) to set the language and switch language servers.

Wrapping up

These are just some highlights from the changes in 22.05. Check out the changelog for the full set. Pick up the release binaries for 22.05 on the release page. Starting with this release, an AppImage is included in the release binaries for easier usage from Linux.

Expect plenty more features and improvements in Helix 22.07 coming in July. Contribute and follow along with development in the GitHub repository and be sure to join in on discussions in the Matrix channel.

Release 22.03 Highlights

Ranging from small quality-of-life improvements and fixes to large features and refactors, Helix 22.03 brings some exciting changes. Helix is a modal text editor with built-in support for multiple selections, Language Server Protocol (LSP), tree-sitter, and now Debug Adapter Protocol (DAP).

Before we look at the highlights, there are some administrative notes. master branch changes are now published separately from the release documentation. Find the new master docs here. Helix is switching versioning schemes. Expect to find new releases in Calendar Version format: YY.0M(.MICRO). We’re aiming to cut regular releases every two months or so. Check out the changelog for all of the new features and fixes from this release.

With that out of the way, let’s check out the highlights!

Health-check

Helix 22.03 brings a new CLI flag: hx --health. Use the new health-check flag to troubleshoot missing language servers and queries.

Check the health of all languages with hx --health or ask for details about a specific language with hx --health <lang>.

w92 h24

Experimental DAP Support

Debug Adapter Protocol (DAP) is an abstract protocol for editors and debuggers to communicate. It’s very similar in spirit to the Language Server Protocol (LSP), but built for debugging. Interact with the debug adapter with <space-d>.

w154 h46

Note that the DAP adapter is experimental: it isn’t yet documented, there may be bugs, and the UX is a bit clunky. Contributions are very welcome!

Incremental Injection Parsing Rewrite

One of the cooler features of syntax highlight driven by tree-sitter is the ability to inject a language into another language’s document. For example, if you’re writing Markdown, you might use a code-fence like so:

This is some rust:

println!("Hello, world!")

Helix highlights the Rust block by injecting tree-sitter-rust. Injections have been rewritten so that changes within are now parsed incrementally, which is a big speed boost when editing documents with large injected blocks.

Along with this rewrite, Helix now supports combined injections. For example, when highlighting Interactive Elixir (IEx), we might have a block of code like the following:

iex> send(self(), :hello)
iex> receive do: (:hello -> :ok)

The IEx grammar injects tree-sitter-elixir into each line after the prompt token. Combined injections cover the case where separate injected documents must be parsed in one combined document, like so:

iex> if true do
...> :ok
...> end

Helix can now parse all three lines together. In the future this can be used to add support for templating languages like EJS or ERB.

Tree-Sitter Grammars Refactor

In the past, tree-sitter grammar repositories have been added to the Helix repository as Git submodules. Submodules can be painful to work with though, especially when there are more than 50 in a repository. Cloning, CI, and packaging times have slowed down as language support has improved.

Helix 22.03 completely overhauls the system for tree-sitter grammars. The headline is that submodules are gone! If you’re working with the source, you can now clone with a standard git clone https://github.com/helix-editor/helix. So where did the tree-sitter submodules go? They’ve been replaced with two new CLI flags: hx --grammar fetch to clone grammar repositories into the runtime directory and hx --grammar build to compile them. Use -g for short. Grammar repositories are shallow-cloned in parallel, so fetching all 60 grammars can now take as little as 6 seconds on a good connection.

If you’re building from source or developing Helix, note that fetching and building are included in the helix-term build step, so you should not need to manually fetch or build grammars.

Additionally, if you would like to customize which tree-sitter grammars you fetch and build, you may now add the use-grammars key to the top of your languages.toml:

w92 h24

If you’re writing a tree-sitter grammar, you can try out integrating it by pointing helix to your grammar’s local path in languages.toml without needing to publish changes to a Git remote:

[[language]]
name = "mylang"
# ..
[[grammar]]
name = "mylang"
source = { path = "/local/path/to/tree-sitter-mylang" }

Running hx -g build will build the grammar. Add some queries and you’re on your way to interactive grammar development.

Up Next

The next release is sure to be exciting as well. Contribute and follow along with development in the GitHub repository and be sure to join in on discussions in the Matrix channel.