# Helix (editor)

**URL:** <https://community.tmpdir.org/t/helix-editor/1244>\
**Category:** Tools\
**Tags:** editor\
**Created:** [February 27, 2024, 10:09pm UTC](https://community.tmpdir.org/t/helix-editor/1244 "2024-02-27T22:09:05Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![cbrake](https://community.tmpdir.org/user_avatar/community.tmpdir.org/cbrake/32/3_2.png) [@cbrake](https://community.tmpdir.org/u/cbrake)\
**Post date:** [February 27, 2024, 10:09pm UTC](https://community.tmpdir.org/t/helix-editor/1244/1 "2024-02-27T22:09:07Z")

</div>

As [lazyvim](https://community.tmpdir.org/t/lazyvim-review/1039) gets more and more bloated, this is looking like an interesting alternative:

> **[Helix](https://helix-editor.com/)**
>
> A post-modern modal text editor.

---

<div class="post-metadata">

**Author:** ![kdsch](https://community.tmpdir.org/user_avatar/community.tmpdir.org/kdsch/32/2797_2.png) [@kdsch](https://community.tmpdir.org/u/kdsch)\
**Post date:** [February 28, 2024, 4:14pm UTC](https://community.tmpdir.org/t/helix-editor/1244/2 "2024-02-28T16:14:16Z")

</div>

I tried Helix over the past few months. I like the pop-up menus and hints about key commands. However, it seems to require some JS components for language support, which I’d rather not install.

---

<div class="post-metadata">

**Author:** ![cbrake](https://community.tmpdir.org/user_avatar/community.tmpdir.org/cbrake/32/3_2.png) [@cbrake](https://community.tmpdir.org/u/cbrake)\
**Post date:** [February 28, 2024, 9:03pm UTC](https://community.tmpdir.org/t/helix-editor/1244/3 "2024-02-28T21:03:12Z")

</div>

I spent some more time with Helix this morning – overall, it is working well. Going through the `:tutor` was instructive to learn the basics. I like the consistency.

Language servers have changed the game and allow things to be a lot more standard, greatly reducing the need for plugins.

Most language server features seem to be working for the languages I program in (C, Go, Elm, Js, Bash, etc) except for linting. I would really like to get linting working in the editor.

Helix does not bind Ctrl-C to exit INS mode (along with Esc), which I use heavily in Vim. I’m trying to stick with standard keybindings as much as possible, so I’ll see if I can learn Esc.

**By far the most important thing is the following tmux tweak that gets rid of a 1s delay when hitting Esc to exit INS mode.** This made Helix feel sluggish inside a tmux session.

`.tmux.conf`

```auto
set -sg escape-time 0

```

Helix config so far:

`config.toml`

```toml
# theme = "onedark"
# theme = "gruvbox"
theme = "dracula"
# theme = "solarized_dark"

[editor]
line-number = "relative"
true-color = true

```

`languages.toml`

```toml
[[language]]
name = "markdown"
auto-format = true
formatter = {command = "prettier", args = ["--parser", "markdown"]}

[[language]]
name = "go"
auto-format = true
formatter = {command = "goimports"}
language-servers = ["gopls", "golangci-lint-langserver"]

[[language]]
name = "javascript"
auto-format = true
formatter = {command = "prettier", args = ["--parser", "typescript"]}

[[language]]
name = "jsx"
auto-format = true
formatter = {command = "prettier", args = ["--parser", "typescript"]}

[[language]]
name = "bash"
auto-format = true
formatter = {command = "shfmt"}

```

I also created a shell script to install various language servers and formatters I use:

```auto
#!/bin/sh

sudo pacman -S shfmt zls shellcheck
npm install -g typescript-language-server typescript prettier bash-language-server
go install golang.org/x/tools/gopls@latest
go install golang.org/x/tools/cmd/goimports@latest
go install github.com/nametake/golangci-lint-langserver@latest
npm update -g

```

I like installing my own tools vs. having something like Mason manage them in Vim. LazyVIM was always telling me I had updates to install, etc. Configuration in the LazyVIM Lua code is also very difficult to understand compared to Helix.

Overall the experience is very good. The configuration is minimal and sane. The defaults are good. Keybindings are more consistent than Vim. I’m not sure if I like the select-action which is the reverse of action-select in Vim, but it seems logical.

---

<div class="post-metadata">

**Author:** ![khem](https://community.tmpdir.org/user_avatar/community.tmpdir.org/khem/32/5_2.png) [@khem](https://community.tmpdir.org/u/khem)\
**Post date:** [February 28, 2024, 9:31pm UTC](https://community.tmpdir.org/t/helix-editor/1244/4 "2024-02-28T21:31:38Z")

</div>

I have been using it as well quite a bit and might switch to it as default too nvim+lazy has made my nvim feel like VSCode, regardless, I open quite large log files from builds etc. and helix is the only viable option which is fast to load and search etc. Here is my config

config.toml

```toml
    #theme = "catppuccin_macchiato"
    #theme = "base16_default_dark"
    theme = "onelight"
    #theme = "dracula_at_night"
    #theme = "dracula"

    [editor]
    #line-number = "absolute"
    mouse = false
    true-color = true

    [editor.cursor-shape]
    insert = "bar"
    normal = "block"
    select = "underline"

    [editor.file-picker]
    hidden = false

```

languages.toml

```toml
    use-grammars = { except = ["gemini"] }

    [[language]]
    name = "markdown"
    language-servers = ["marksman", "ltex-ls"]

    [[language]]
    name = "python"
    language-servers = ["pyright"]

    [[language]]
    name = "bitbake"
    scope = ""
    file-types = ["bb", "bbappend", "bbclass", "inc"]
    roots = []

    [[grammar]]
    name = "bitbake"
    source = { git = "https://github.com/amaanq/tree-sitter-bitbake", rev = "10bacac929ff36a1e8f4056503fe4f8717b21b94" }

```

---

<div class="post-metadata">

**Author:** ![cbrake](https://community.tmpdir.org/user_avatar/community.tmpdir.org/cbrake/32/3_2.png) [@cbrake](https://community.tmpdir.org/u/cbrake)\
**Post date:** [February 28, 2024, 10:04pm UTC](https://community.tmpdir.org/t/helix-editor/1244/5 "2024-02-28T22:04:19Z")

</div>

The folks in the Helix Matrix suggest binding Caps-lock to Esc. This is easy to do in KDE:

 ![image](https://community.tmpdir.org/uploads/default/original/2X/b/baa433edf4d50ad416bd3af34c2d437ff09cf9f6.png)

The neat thing about this approach is that it will work in any app (vim, etc).

---

<div class="post-metadata">

**Author:** ![cbrake](https://community.tmpdir.org/user_avatar/community.tmpdir.org/cbrake/32/3_2.png) [@cbrake](https://community.tmpdir.org/u/cbrake)\
**Post date:** [February 28, 2024, 11:13pm UTC](https://community.tmpdir.org/t/helix-editor/1244/6 "2024-02-28T23:13:47Z")

</div>

shellcheck (shell linter) is now working:

 ![image](https://community.tmpdir.org/uploads/default/original/2X/0/0734f41ad0b297f8e32f948986ad586a0504497c.png)

@khem we should clean up Yoe `envsetup.sh` some 🙂

`golangci-lint-langserver` still not working …

---

<div class="post-metadata">

**Author:** ![khem](https://community.tmpdir.org/user_avatar/community.tmpdir.org/khem/32/5_2.png) [@khem](https://community.tmpdir.org/u/khem)\
**Post date:** [February 28, 2024, 11:44pm UTC](https://community.tmpdir.org/t/helix-editor/1244/7 "2024-02-28T23:44:09Z")

</div>

Yes shell check fixes are welcome

---

<div class="post-metadata">

**Author:** ![cbrake](https://community.tmpdir.org/user_avatar/community.tmpdir.org/cbrake/32/3_2.png) [@cbrake](https://community.tmpdir.org/u/cbrake)\
**Post date:** [February 29, 2024, 8:29pm UTC](https://community.tmpdir.org/t/helix-editor/1244/8 "2024-02-29T20:29:32Z")

</div>

Default language config for helix:

> <https://github.com/helix-editor/helix/blob/master/languages.toml>

Not sure if they bundle this with the app – I don’t see it installed by the package.

---

<div class="post-metadata">

**Author:** ![cbrake](https://community.tmpdir.org/user_avatar/community.tmpdir.org/cbrake/32/3_2.png) [@cbrake](https://community.tmpdir.org/u/cbrake)\
**Post date:** [February 29, 2024, 9:52pm UTC](https://community.tmpdir.org/t/helix-editor/1244/9 "2024-02-29T21:52:13Z")

</div>

Go linting is now working:

```diff
diff --git a/.config/helix/languages.toml b/.config/helix/languages.toml
index 2acfb9521..1c63d4cd2 100644
--- a/.config/helix/languages.toml
+++ b/.config/helix/languages.toml
@@ -8,7 +8,13 @@ formatter = {command = "prettier", args = ["--parser", "markdown"]}
 name = "go"
 auto-format = true
 formatter = {command = "goimports"}
-language-servers = ["gopls", "golangci-lint-langserver"]
+language-servers = ["gopls", "golangci-lint-lsp"]
+
+[language-server.golangci-lint-lsp]
+command = "golangci-lint-langserver"
+
+[language-server.golangci-lint-lsp.config]
+command = ["golangci-lint", "run", "--out-format", "json", "--issues-exit-code=1"]

```

This is already in the default `languages.toml` for helix – perhaps it has just not made it into the Arch packaged version yet …

This now shows Go linting errors:

 ![image](https://community.tmpdir.org/uploads/default/original/2X/a/acb9f2fe6aeb193560c20618bd58824974926ac5.png)

 ![image](https://community.tmpdir.org/uploads/default/original/2X/3/3b9e9f852f9c3ab9decb08c398645a65d8f4eeec.png)

---

<div class="post-metadata">

**Author:** ![cbrake](https://community.tmpdir.org/user_avatar/community.tmpdir.org/cbrake/32/3_2.png) [@cbrake](https://community.tmpdir.org/u/cbrake)\
**Post date:** [February 29, 2024, 10:21pm UTC](https://community.tmpdir.org/t/helix-editor/1244/10 "2024-02-29T22:21:51Z")

</div>

This is a cool hack:

```diff
diff --git a/.config/helix/config.toml b/.config/helix/config.toml
index 6ba117457..4924dcc67 100644
--- a/.config/helix/config.toml
+++ b/.config/helix/config.toml
@@ -6,3 +6,6 @@ theme = "dracula"
 [editor]
 line-number = "relative"
 true-color = true
+
+[keys.normal]
+C-g = ":sh tmux popup -d \"#{pane_current_path}\" -xC -yC -w80% -h80% -E lazygit"

```

This opens lazygit in a tmux popup:

 ![image](https://community.tmpdir.org/uploads/default/original/2X/1/1e6c153caac03e28c4a374a94d2201f0af5840a5.jpeg)

---

<div class="post-metadata">

**Author:** ![khem](https://community.tmpdir.org/user_avatar/community.tmpdir.org/khem/32/5_2.png) [@khem](https://community.tmpdir.org/u/khem)\
**Post date:** [March 3, 2024, 7:56pm UTC](https://community.tmpdir.org/t/helix-editor/1244/11 "2024-03-03T19:56:18Z")

</div>

Alright time to switch default to force muscle memory change 🙂

 ![Screenshot 2024-03-03 at 11.55.07 AM](https://community.tmpdir.org/uploads/default/original/2X/3/34a6fefaa8dd98754967a526ff23412a53db1840.png)

---

<div class="post-metadata">

**Author:** ![khem](https://community.tmpdir.org/user_avatar/community.tmpdir.org/khem/32/5_2.png) [@khem](https://community.tmpdir.org/u/khem)\
**Post date:** [March 4, 2024, 3:36pm UTC](https://community.tmpdir.org/t/helix-editor/1244/12 "2024-03-04T15:36:05Z")

</div>

if you use ‘D’ in vim/nvim to delete till end of line then you can do so in helix by adding this to `~/.config/helix/config.toml`

```auto
[keys.normal]
# Delete till end of line shortcut D to match vim
D = ["ensure_selections_forward", "extend_to_line_end", "delete_selection"]

```

---

<div class="post-metadata">

**Author:** ![cbrake](https://community.tmpdir.org/user_avatar/community.tmpdir.org/cbrake/32/3_2.png) [@cbrake](https://community.tmpdir.org/u/cbrake)\
**Post date:** [March 4, 2024, 9:27pm UTC](https://community.tmpdir.org/t/helix-editor/1244/13 "2024-03-04T21:27:32Z")

</div>

# Global search and replace

Summary:

- `%` - select entire file
- `s` - select
- type text you want to find
- `enter`
- scroll through the file to make sure selections look good
- `c` - change
- type new text
- `,` - remove select/multiple cursors

[![](https://community.tmpdir.org/uploads/default/original/2X/a/a4148be576b383f9fb5784c79b98e54cf632beb8.jpeg "Helix text editor: global search and replace") ](https://www.youtube.com/watch?v=8jfLjRmtm-s)

---

<div class="post-metadata">

**Author:** ![khem](https://community.tmpdir.org/user_avatar/community.tmpdir.org/khem/32/5_2.png) [@khem](https://community.tmpdir.org/u/khem)\
**Post date:** [March 5, 2024, 1:14am UTC](https://community.tmpdir.org/t/helix-editor/1244/14 "2024-03-05T01:14:01Z")

</div>

As a vim nerd I want this feature

> <https://github.com/helix-editor/helix/pull/4204>
>
> This adds a few new movement commands to allow \`hjkl\` to be rebound so that they… follow more the movement of vim. left/right movement cannot move between lines and up/down either follows newline or does not accidentally move onto the newline character. See #4268 for motivation. This however does not emulate vim, it just has some vim inspired movements. In particular it retains the entire behavior of Helix with regards to how newlines are otherwise handled (they stay selectable, and these alternative movement commands to not interfere with other commands in use or change their assumptions).
> 
> !\[vim-movement mov\](https://user-images.githubusercontent.com/7396/195949926-ad74756f-901b-4afa-b995-b907c0f469b6.gif)
> 
> The following commands are added:
> 
> \* \`move\_line\_up\_anchored\` (bind to \`k\`): implements anchored movement up
> \* \`move\_line\_down\_anchored\` (bind to \`j\`): implements anchored movement down
> \* \`move\_char\_left\_same\_line\` (bind to \`h\`): implements same-line movement left
> \* \`move\_char\_right\_same\_line\` (bind to \`l\`): implements same-line movement right
> \* \`extend\_line\_up\_anchored\` (bind to \`k\`): implements anchored selection extension up
> \* \`extend\_line\_down\_anchored\` (bind to \`j\`): implements anchored selection extension down
> \* \`extend\_char\_left\_same\_line\` (bind to \`h\`): implements same-line selection extension left
> \* \`extend\_char\_right\_same\_line\` (bind to \`l\`): implements same-line selection extension right
> 
> \## Bindings
> 
> \`\`\`toml
> \[keys.normal\]
> j = \["move\_line\_down\_anchored"\]
> k = \["move\_line\_up\_anchored"\]
> h = \["move\_char\_left\_same\_line"\]
> l = \["move\_char\_right\_same\_line"\]
> 
> \[keys.select\]
> j = \["extend\_line\_down\_anchored"\]
> k = \["extend\_line\_up\_anchored"\]
> h = \["extend\_char\_left\_same\_line"\]
> l = \["extend\_char\_right\_same\_line"\]
> \`\`\`
> 
> \## Same Line Movement
> 
> The default movement behavior of helix will happily place you in the next line. Vim users are not used to that and are likely to prefer the cursor not to move into the next line (that is at least my expectation). This is what \`move\_char\_left\_same\_line\` and \`move\_char\_right\_same\_line\` do. They will however let you move to the rightmost character (the newline) which is not what vim does (except of \`virtualedit=oneline\` is used). However this pairs up nicely with the anchored movement (see next).
> 
> \## Anchored Vertical Movements
> 
> The two commands \`move\_line\_up\_anchored\` and \`move\_line\_down\_anchored\` implement what I would call anchored movement. If you are on the newline character (eg: one to the right of where \`goto\_line\_end\` would place you) then as you move up and down you end up on the newline of the target line again. This emulates the behavior of vim of what happens if you move to the line end with \`$\`. If however you are placed to the left of the newline, as you move up and down you will not move onto the newline.
> 
> The main difference is that in vim if you use \`$\` and go up/down you stay anchored to the line end. In Helix with this change you need to do \`gll\` to stay anchored to the newline. I do however have to say that I prefer this actually because in Vim you do not actually know if you are newline anchored visually. That is as far as I can tell an internal state.
> 
> I played around with this a bit now and I really like the combination of the two. It stays true to the helix character model, but it also feels very natural for vim users.
> 
> \*\*Limitation:\*\* Movements across empty lines are ambiguous. To help with this I put the horizontal column to the largest possible integer on the range to tell these cases apart. From what I can tell this does not create negative impact and avoids extra complication on the range.
> 
> \## Notes on Mixed Use
> 
> I think these move/extend commands are interesting to use independent of each other. For instance I find the anchored newline movement functionality useful even if one does not like restricting the movements within a line. For instance line based selection works really nice as once the visual selection is on the newline, any further moving down will continue to capture entire lines. That means for instance \`vx\` will continue to move downwards which I think also addresses some points of #1638 as it basically keeps you in line mode for as long as you don't move left.

---

<div class="post-metadata">

**Author:** ![cbrake](https://community.tmpdir.org/user_avatar/community.tmpdir.org/cbrake/32/3_2.png) [@cbrake](https://community.tmpdir.org/u/cbrake)\
**Post date:** [March 5, 2024, 8:35pm UTC](https://community.tmpdir.org/t/helix-editor/1244/15 "2024-03-05T20:35:43Z")

</div>

Cleaning up disk space in my home dir ([ncdu](https://community.tmpdir.org/t/ncdu-a-great-tool-for-tracking-down-where-disk-space-is-going/1108) is an amazing tool!):

 ![image](https://community.tmpdir.org/uploads/default/original/2X/1/17d1af37f6112a7c5b77c177b52cd166fc314a46.png)

lazyvim is pretty heavy. It is neat that it downloads everything you might ever need into the .local/share/nvim, but it is also starting to resemble NPM or VSCode a bit …

One of the best things about Helix is it starts instantly and is not reminding me to update gobs of stuff every single day. I’m all for [living on the edge](https://community.tmpdir.org/t/episode-24-living-on-main/1205), but there are practical limits. I don’t update my Arch system daily, rather weekly or bi-weekly.

There is a balance between getting new and good stuff, and the overhead of updating.

---

<div class="post-metadata">

**Author:** ![khem](https://community.tmpdir.org/user_avatar/community.tmpdir.org/khem/32/5_2.png) [@khem](https://community.tmpdir.org/u/khem)\
**Post date:** [March 6, 2024, 3:55am UTC](https://community.tmpdir.org/t/helix-editor/1244/16 "2024-03-06T03:55:57Z")

</div>

All is not rosy - Here is a simple crash seen editing a .bb file trying to change SRCREV hash thats all

```auto
❯ RUST_BACKTRACE=1 vi meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.19.bb
thread 'main' panicked at helix-core/src/indent.rs:465:21:
Invalid indent query: Unknown predicate ("lua-match?")
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

```

---

<div class="post-metadata">

**Author:** ![khem](https://community.tmpdir.org/user_avatar/community.tmpdir.org/khem/32/5_2.png) [@khem](https://community.tmpdir.org/u/khem)\
**Post date:** [March 6, 2024, 3:57am UTC](https://community.tmpdir.org/t/helix-editor/1244/17 "2024-03-06T03:57:51Z")

</div>

My helix has quite a bit bt now, wait for few months 🙂

```auto
kraj@apollo ~/.config/helix
❯ du -sh .
1.1G .
1.1G total

```

```auto
❯ ls
config.toml languages.toml runtime/

```

---

<div class="post-metadata">

**Author:** ![cbrake](https://community.tmpdir.org/user_avatar/community.tmpdir.org/cbrake/32/3_2.png) [@cbrake](https://community.tmpdir.org/u/cbrake)\
**Post date:** [March 6, 2024, 4:00pm UTC](https://community.tmpdir.org/t/helix-editor/1244/18 "2024-03-06T16:00:22Z")

</div>

> [@khem](#):
>
> `Invalid indent query: Unknown predicate ("lua-match?")`

Do you have any idea where the “lua-match” is coming from? Is there Lua code running somewhere?

---

<div class="post-metadata">

**Author:** ![cbrake](https://community.tmpdir.org/user_avatar/community.tmpdir.org/cbrake/32/3_2.png) [@cbrake](https://community.tmpdir.org/u/cbrake)\
**Post date:** [March 7, 2024, 12:47pm UTC](https://community.tmpdir.org/t/helix-editor/1244/19 "2024-03-07T12:47:15Z")

</div>

HTML auto-completion example:

 ![image](https://community.tmpdir.org/uploads/default/original/2X/e/e3f583b9e8a4c5a9a131789cc056a83aa0378537.png)

(someone on YouTube was asking and I needed a place to upload an image).

---

<div class="post-metadata">

**Author:** ![cbrake](https://community.tmpdir.org/user_avatar/community.tmpdir.org/cbrake/32/3_2.png) [@cbrake](https://community.tmpdir.org/u/cbrake)\
**Post date:** [March 12, 2024, 3:01pm UTC](https://community.tmpdir.org/t/helix-editor/1244/20 "2024-03-12T15:01:58Z")

</div>

# Bufferline

I’ve always liked having a bufferline:

```diff
diff --git a/.config/helix/config.toml b/.config/helix/config.toml
index 58f818e..633a313 100644
--- a/.config/helix/config.toml
+++ b/.config/helix/config.toml
@@ -7,6 +7,7 @@ theme = "ayu_evolve"
 [editor]
 line-number = "relative"
 true-color = true
+bufferline = "multiple"
 
 [editor.cursor-shape]
 insert = "bar"

```

 ![image](https://community.tmpdir.org/uploads/default/original/2X/6/6bdc64d0fca5737118d518845fa7b51b2a11c067.png)

[Next page](https://community.tmpdir.org/t/helix-editor/1244.md?page=2)
