Rethinking Helix

40 points by hush


T6

To me, this misses the point of the selection -> action model. If one is using it like vim, and making exactly one selection and then performing exactly one action, it is by all means more cumbersome and less ergonomic.

The point of selecting before acting is that the commands can compose to a much greater degree. With helix, you can make a selection, perform an action on that selection (which preserves the selection), then expand the selection, perform two more actions, etc.

Suppose I’m editing foo(baz.qux), am currently inside the parens, and I would like to change it to foo(bar(baz.qux)).

In helix, I can type:

In vim, I could type ysi(( (if memory serves) to accomplish the first two steps. And if that’s all I want to do, it was one character shorter! However, after I do that, all context related to the parens is gone, so when I want to prepend bar, I need to perform another motion to get back there.

I find that editing in vim essentially follows a model of small, independent changes. What is really powerful in helix is that you can chain multiple selections and actions together in complex ways. This is especially enhanced by multi cursor editing, which combined with helix's other features, allows performing complex structural modifications in multiple places simultaneously.

So yes, individual commands are longer, because of the shared namespace, and there are more things to think about in each command, but the result is, IMO, an editing language that is significantly more expressive and powerful.

I do agree with done of the article's critiques, in the there are some commands which are inconsistent with others, or behaviors that haven't been standardized, etc. But I think this is to be expected in the early days, and can improve with time. Many of these rough edges can also be fixed with a local keymap — for example, I have w bound to miw, like the article suggests, and instead of using x (which has rather odd behavior), I have a V binding which extends to line bounds and enters selection mode, and shift-[direction] keys in selection mode which moves in that direction and extends to line bounds, allowing a visual line like mode, with the slight modification that shift is held through the whole selection, not just for V.

valpackett

Helix conflates movement and selection. Each command decides what happens to the anchor. We lose in predictability what we gain in flexibility.

I've switched first to Kakoune back when that made a splash and later to Helix when it became viable enough. I have never found them to be unpredictable in any way. In fact the massively increased interactive feedback from building up selections makes everything more predictable!