Neovim - Customizable Helix alternative
This a continuation to my last article about Helix.
Being inspired, but I still came back
My brief run with Helix is coming to an end for now. After using Helix for around two weeks I started having an urge to bring my Neovim config up to speed instead of launching Helix.
What I gained from trying Helix was some much-needed perspective and joy to delve into my Neovim configuration. Instead of making large changes, I mostly went through my config again trying to discover things that I had missed or forgotten about.
I did take the time to finally setup prettier for additional formatting and put on a shiny new theme to feel cool; onedark - warmer.
I also took some inspiration from Helix’ keybinds.
I copied Helix’ copy paste functionality; my Neovim config used the system clipboard by default, which can be annoying when you need to redo paste or paste to multiple places because it overwrites the clipboard contents. A choice I made long ago and needed a fresh perspective to realize my mistake.
-- Instead of defaulting to system clipboard, access it with leader
vim.keymap.set('v', '<leader>y', '"+y', { desc = 'Copy selection to system clipboard' })
vim.keymap.set({ 'n', 'v' }, '<leader>p', '"+p', { desc = 'Paste from system clipboard' })
-- I also really liked % selecting the whole buffer so decided to emulate it
vim.keymap.set('n', '<leader>%', 'ggVG', { desc = 'Select the whole buffer' })
Inspired by the gw jump I decided to take Leap for a spin.
And I found out about Telescope’s
current buffer fuzzy finder by it sharing the global search key mapping in Helix.
I also will pay more attention to Which Key for a while, it’s easy to just do things instead of stopping to see what’s possible.
It depends
Comparing a fully configured Neovim with Helix is hard. I think with enough time and effort Neovim as an editor wins everytime, but time and effort are a cost that some people don’t want to pay because they have better things to do. So in certain situations Helix is the clear winner.
Compared to the three lines of config that I had for Helix my Neovim config is split across multiple files and consist of more than thousand lines. Not as bad as it sounds because most of it is preconfigured as it is a fork of kickstart.nvim. There around 150 lines of differences between my fork and Kickstart, but most of those actually come from themes and are totally unnecessary, so my config is pretty vanilla.
What drove me back?
The list I gave in the previous article summed it up really well. Vim bindings are pretty much everywhere and they just work for me.
Having consistent bindings is just nice. Missing Vim’s select, replace, and delete inside/outside ci" da( etc. was a thing that I noticed enough that it was bothering me.
And I cannot forget commands; for example being able to modify a replace command :%s/origi[n]+al/replace live while using regex is truly miraculous.
Lesson from Helix
I think the biggest thing that I enjoyed about Helix was the feeling of having a single download that just works. Neovim tends to be quite stable, but I’ve still had some issues between different machines and versions.
I decided to package my Neovim configuration with some binaries to a Git repository so I can just clone and play. The repository includes a Neovim AppImage, rust-analyzer binary, all of the plugins (as files not as submodules), etc.
I will likely return to this in a future post.
# It just works
git clone portable-nvim
cd portable-nvim
./nvim
# Adding it to path
sudo ln -s nvim /usr/local/bin/nvim
nvim
Little bit closer to having the best of both worlds.
Easy customizability and AI
Another thing that I realized during this period is, that it is now sometimes possible to just summon custom tools with minimal effort. Neovim being so customizable and powerful means that you have good chance to one shot a working tool for that one job that you’ll never have to do again.
For example; I’ve been using vanilla Neovim for work and missed Telescope very much. I prompted Gemini to create a file picker for vanilla Neovim and it conjured up a basic fuzzy file finder using ripgrep and fzf.
Creating vim scripts, custom actions and custom tools with lua can be really powerful for solving simple tasks. It gives Neovim an additional edge that is hard to contend with.
Conclusion
I was really excited about Helix, but it is hard to lose some tools that I’ve gotten used to and I did start to miss Neovim.
I really needed a kick to improve my config; Helix did give me that and I’m happier for it.
I don’t think that my opinion changed between the last article and this one. Maybe I just hoped that I would have finally been part of the group that have better things to do than configure their editor, but where’s the fun in that.
There isn’t an answer which one is better, you’ll just have to try and feel them out. Helix has smoother starting curve, so I would still recommend it for first timers. And I do still maintain that even Vim veterans can get something out of it, I know I did.