Helix (editor)

Advanced select and replace using multiple select

This shows how to use a select within a select which can do some of the things you would traditionally use a Regex group for.

When editing files in a project (typically OSS) where you are not the principal author, often you don’t want to auto-format on save. To disable this at run-time:

:set auto-format false

how do we make it permanent ?
nvim had this smart indention which deduced it smartly and did the needed.

I think you can add to your config.toml file:

[editor]
auto-format = false

It is neat how you can set these options easily in config or at runtime.

https://docs.helix-editor.com/configuration.html

One thing about Helix is the configuration and keymaps are still small enough that things are discoverable by reading the documentation which is all in one place. With nvim, it is endless Googling and plugins. It is similar to the difference between Yocto and Zephyr – with Zephyr, everything is in one place in one cohesive system. With Yocto, you need to figure out core, various layers, make them all work together, etc.

Here is another way to do this (from reddit):

Alt-;;a0 to prepend the 0 instead of the second select operation

I kind of like that Helix does not leave lock files lying around if the editor is killed for some reason …

1 Like

Handy Hotkey sheet - Helix Keyboard Shortcuts by HiddenMonkey - Download free from Cheatography - Cheatography.com: Cheat Sheets For Every Occasion

Helix 24.03 release:

1 Like

Downloaded the latest Helix release binaries to a NXP i.MX 8M Nano platform I’m working on – works great:

@khem what do you think of meta-helix-binary, or helix-binary.bb in meta-yoe?

Thinking a little more, it would be neat to add rg, fd, sd, yazi, etc. as well …

I think if we want to package up a developer tool suite which is binary utilities then perhaps we can create a single recipe for all of them and add or remove it but single recipe is ok too

I am open for it seems useful on debug and developer images

sd/fd/rg – is the new trifecta of powerful command line apps – I’m really starting to like them – so easy to use compared to the traditional sed/find/grep …

Agreed, fd, bat and ripgrep are already on finger tips sd not so much

How Language Servers even help you edit documentation

One thing I like about Helix is its good defaults for language servers – simply install the language server and you are ready to go in most cases. Languages servers can even help with simple tasks like editing documentation. See the demo below:

1 Like

While working in terminal multiplexer ( zellij ) with mouse-mode enabled, mouse selection can be copied to system clipboard automatically by installing xsel on the system.

sudo pacman -S xsel

Now selection is automatically copied into clipboard and can be yanked elsewhere ( e.g. another pane) with paste action (Command + p on mac )

1 Like

xsel looks generally really useful – just learned you can do things like:

xsel < file
xsel > file

and lots more …

I am also seeing a hang

❯ git rebase upstream/master -i
hint: Waiting for your editor to close the file...

If this happens it means there is some issue with how helix is installed.

in my case I have a symlink called hx pointing to /usr/bin/helix once I remove that then it works.

Multiple cursors support is quite powerful for advanced editing.

C to create new cursor below current one
s to put cursors on regexes in selected text
, to remove all additional cursors
Alt-, to remove a specific cursor; ( and ) to cycle for which to remove
1 Like

A file explorer for Helix

One thing I still miss is a file explorer. I’ve been using Yazi outside of Helix and delighted to learn you can now launch Yazi from Helix and pick files:

This launches Yazi from a Zellij floating window. Since I’m using Helix, Yazi, and Zellij anyway, this works very well.

1 Like