Text Editors

I have used vim for some 20+ years. I have tried neovim at several occassions and not felt an urge to switch. However, at some pointin 2023 a co-worker of mine showed me LunarVIM and i took it for a spin. I liked it, and ditched my handrolled vim configs in favor of the turn-key setup provided by LunarVIM.

At that stage nothing felt sacred anymore and at that point then the very same co-worker showed me the Helix editor, then I decided to just go all-in.

The only thing I don’t like about the Helix editor are two tings:

  • There are no packages for Debian Linux

  • The name of the executable hx. I might just be scarred from typing vim for decades.

So, currently piloting vanilla vi and vim on systems where they are available, and for my main text-editor and code-mangling I use Helix. Thus, this page is re-written with notes on getting the Helix editor running.

Install from source

Do this:

# Build and install
cd ~/git
git clone https://github.com/helix-editor/helix
cd helix
cargo install --path helix-term --locked

# Runtime Files
hx --health
ln -Ts $PWD/runtime ~/.config/helix/runtime
hx --grammar fetch
hx --grammar build
hx --health

# Create a system-wide symlink named 'lvim'
sudo ln -s /home/safl/.cargo/bin/hx /usr/local/bin/lvim

It might seem like weird thing to name a symlink for the Helix Editor. However, as mentioned, then I have used vim for a long time, so it is ingrained in my muscle-memory. The addition of l infront comes from when I used Lunar VIM. Thus, today, I like to use they plain version of vi-iMprovied using vim and then having my fancy editor at lvim.

Configs

~/.config/helix/languages.toml:

[[language]]
name = "c"
#indent = { tab-width = 8, unit = "        " }
indent = { tab-width = 8, unit = "\t" }
file-types = [ "c", "h"]
rulers = [99]
text-width = 99

[[language]]
name = "git-commit"
rulers = [72]
text-width = 72

[[language]]
name = "python"
rulers = [88]
text-width = 88

~/.config/helix/config.toml:

theme = "tokyonight_storm"

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

[editor.lsp]
display-messages = true
display-inlay-hints = true

[editor]
mouse = false
bufferline = "multiple"
true-color = true
rulers = [80]
cursorline = true
color-modes = true
insert-final-newline = false

[editor.file-picker]
hidden = false

[keys.normal]
esc = ["collapse_selection", "keep_primary_selection"]
G = "goto_file_end"
X = "extend_line_above"
ret = ["move_line_down", "goto_line_start"]
C-n = ["extend_to_line_bounds", "delete_selection", "paste_after"]
C-tab = ":bn"
C-S-tab = ":bp"

[keys.select.g]
w = ":reflow"

[keys.normal.space]
q = ":quit"
n = ":bn"

[editor.whitespace.render]
space = "all"
tab = "all"
newline = "none"

xorg clipboard (Space+Y)

Needs these packages as well:

sudo apt-get install -qy xsel xclip