I recently discovered the text editor Helix, a relatively new project written in Rust. Many features, like Tree-sitter integration or support for the Language Server Protocol LSP are available by default without any plugins and laborious configuration. This short note shows how to integrate Helix with the template tool Tp-Note and the grammar checker LanguageTool under Linux.

Helix syntax highlighting with Tree-Sitter

Installation and configuration


Download a recent version of Tp-Note and follow the Tp-Note's installation instructions.

Tp-Note needs to know how to start your favourite terminal emulator in a way that it invokes Helix at startup. Add the following lines to /etc/environment, with sudo nano /etc/environment:

TPNOTE_EDITOR="xfce4-terminal --disable-server -x hx"

The last line, configures Tp-Note's language detection feature. Here you indicate a list of languages you usually write your notes in. Alternatively, the equivalent environment variable setting can be achieved with a configuration file in ~/.config/tpnote/tpnote.toml with the following content:

unix.editor = [ [ "xfce4-terminal", "--disable-server", "-x", "hx" ] ]
unix.editor_console = [ [ "hx" ] ]

name = "default"
filter.get_lang = ["en", "de"]
filter.map_lang = [ ["en", "en-GB"],  ["de", "de-DE"] ]

More configuration options are described on Tp-Note's manual page .

For convenience, I added some custom actions to my file manager Thunar by inserting the following <action> tags in /etc/xdg/Thunar/uca:

  <command>tpnote %f</command>
  <name>Tp-Note View</name>
  <command>tpnote -v -n %f</command>
  <description>Tp-Note View</description>
  <patterns>*.txt; *.md;*.rst;*.adoc</patterns>

Please refer to Tp-Note's user manual for instructions how to configure other file managers or other operating systems.


As LanguageTool has no direct support the Language Server Protocol LSP, we need a protocol converter. The proxy software LTeX ships with a LanguageTool standalone version and exposes the LSP protocol. Follow the installation instructions for LTeX-LS.


Helix has built-in support for the LSP protocol. Follow the installation instructions for your operating system. In order to tell Helix the path to the above LTeX-LS installation, we create the additional configuration file /home/<username>/.config/helix/languages.toml with the following content:

name = "markdown"
language-servers = [{ name = "ltex"}]
file-types = ["md", "txt"]
scope = "text.markdown"
roots = []

command = "/opt/ltex-ls/bin/ltex-ls"

"en-US" = ["Tp-Note","Zettelkasten"]

Hereby indicates the expression command =/opt/ltex-ls/bin/ltex-ls the path to the shell script ltex-ls which is part of the LTeX-LS installation. Change this to path to the location where you unpacked LTeX-LS.


Create a new note by invoking Tp-Note (more examples here):

mkdir "Build a Crypto Currency"
cd "Build a Crypto Currency"

Tp-Note opens the Helix editor which starts for its part the LanguageTool grammar checker. Note, that the grammar checker reads the header variable lang: indicating the language of the current note. In the below example, its value en-US is automatically determined by Tp-Note's linguistic language detection feature. If Tp-Note's suggestion does not fit, it can be overwritten in the note's YAML header.

Hover the cursor over the word “However” to see what is wrong:

A comma may be missing ...

Type [space], [a] to see the suggested corrections:

Navigate with Ctrl-n and commit your choice with Enter:


No additional plugins or any further configuration is needed so far. Everything should work out of the box.

However, for completeness you will find below my Helix configuration file ~/.config/helix/config.toml.

theme = "autumn"

color-modes = true
auto-save = true
soft-wrap.enable = true
middle-click-paste = false
rulers = [80, 100]

display-messages = true
display-inlay-hints = true

insert = "bar"
normal = "block"
select = "underline"

left = ["mode", "spinner"]
center = ["file-name"]
right = ["diagnostics", "version-control", "selections", "position", "file-encoding", "file-line-ending", "file-type"]

j = { k = "normal_mode" } # Maps `jk` to exit insert mode.
C-h = "delete_char_backward" # Most terminals do this by default.
C-l = "move_char_right" # Useful to jump over a closing parenthesises.
C-s = ["save_selection", ":w"] # Add `:w` to the default binding.

Z = { Z = ":wq" } # Shortcut to save and close buffer.
C-h = "delete_char_backward" # Most terminals do this by default.
C-l = "move_char_right" # Useful to jump over a closing parenthesises.
C-s = ["save_selection", ":w"]
C-j = "jump_backward" # C-o is sometimes captured by the "MidnightCommander"

Read more about Tp-Note

A good start is Tp-Note's project page or the introductory video. The source code is available on GitHub - getreu/tp-note and some binaries and packages for Linux, Windows and Mac can be found here. To fully profit of Tp-note, I recommend reading Tp-Note's user manual. If you like Tp-Note, you probably soon want to customize it. How to do so, is explained in Tp-Note's manual page.

Last updated: 20230520