← Back to context

Comment by saidnooneever

7 days ago

cool stuff, for a bunch i didnt realise they were really distinct versions!

Use Helix now as the first one that stuck in my fingers though. before that it was always try a lil while and forget it (back to nano...).

Helix i think is like 'user friendly vi' or maybe 'no config vi'. dont need any plugins or weird stuff. everything essential works out of the box (for me)

Helix's selection-action feels way more natural to me than vi/vim's action-selection.

  • Had someone else parrot this line to me the other day, but I remain unconvinced. Especially when vim has visual mode, and you often can make a select before doing something to it. v$ to select from cursor to end of line, then d to cut or y to copy. Is that not the sort of thing you mean? Is visual mode in vim just underused?

    Recently I was trying to find a good way to delete from the current position backward to another character, like dT or dF followed by the target character. The trouble was they'd leave at least one character behind, either what I jumped to or what I started on. What worked how I want, and was still easy, was just using visual mode. Where "n" was the character to jump back to, I did vFn which selected from my cursor position back to the letter n (and including that n). I could then hit d and delete all of it, no extra character left behind from either end. I remember at first I was thinking "there's gotta be a way to do this without visual mode". Best I could come up with was hitting x after dFn or whatever to get the stray character. I think using visual mode is probably fine, though. Maybe if I were doing this type of edit a lot I could bind some key sequence to do it.

    Would it be accurate to say you didn't use visual mode much in vim before you moved to Helix?

    • I use visual mode all the time in both vim and helix. Again, the overall selection-action feels more natural for me and doesn't require a separate mode for basic editing, nor do I want to have to switch back and forth from action-selection and selection-action. Also, visual mode is just not equivalent.

      For example, I can move forward by word with 'w' and when I get to the word I want to delete, just hit 'd', or edit it at the beginning with 'i' or end with 'a', or surround with parentheses with 'ms('.

      I don't want to have to go into a completely separate mode. It's annoying and I have to constantly be cognizant that I need to switch to that mode just to do basic text editing.

      > Had someone else parrot this line to me the other day, but I remain unconvinced.

      Side note: this comes off as condescending, as if I need to convince you of the validity of my subjective experience. So, along the same lines: I'm unconvinced there is any good argument for vim's action-selection way of doing things when practically no other UI works like that. It's like hitting ctrl+c before highlighting the text you want to copy with your mouse.

    • Something rather similar to visual mode, and which I've learned to like a lot, is the https://github.com/folke/flash.nvim plugin (NeoVim only since it uses Lua). It gives you a commmand you can bind to a key (https://www.lazyvim.org/ defaults to binding it to `s` for "Seek"). Press that key and then type a couple letters that appear somewhere on your screen. All occurrences of the letters you typed will be highlighted (and the rest will be dimmed), and next to each of them will appear a bright, contrasting letter that serves as a label. Type the label character and you will jump to the start position of the text you typed.

      Why is that handy? Well, the idea is that you're probably already looking at the point on the screen you want to move the cursor to, so instead of figuring out a complex navigation, you can type a few keys: `s` plus the letters you're looking at. Then pause for a quarter-second, and type the letter that just appeared where you're looking at. The label letters will be chosen such that none of them appear after the text you typed, e.g. if the words "car", "cat", and "can" all appear in your document, then after you press `sca` the labels `r`, `t`, and `n` will never be chosen. (But the label `d` might be chosen if the word "cad", or words containing it such as "academic", never appear in the document).

      It took a little getting used to, but now I've found it's quite the fastest way to issue commands. Want to delete everything from here to that closing parenthesis right there? If you're on its matching open parenthesis then `d%` is fastest, but if you're not, then `ds)` followed by split-second pause to see the label appear (in a bright contrasting color), then type the label. Quite a bit faster than `v` plus a bunch of movement, in my experience. Once you get used to it, it really speeds you up.

      And when you get down to it, isn't "once you get used to it, it really speeds you up" a description of the entire vi family of editors in the first place?

    • Well that's one extra key press for every action. For example, you have to do `ved` to delete the current word instead of `de`. Whereas in Helix it's just `ed`.

      Also visual mode doesn't work the same. If I want to delete up to the next word normally I do `dw`, but if I do `vwd` then I also delete the first letter of the next word. I guess in visual mode you'd have to do `vwhd` or `vawd`? Which is 4 keypresses instead of 2, which isn't great for something that I do all the time.

    • I think you're right and visual mode is underused. It gives you the best of both worlds: "cw" meaning "change word" for when it's obvious what you're going to be selecting, and "v3wwwc" for "change 5 words" when you discover (by experimentation) that the text you wanted to change actually counted as 5 words due to punctuation, not 3 as you had first thought.

I really want to use Helix, it clicks with me so much more. But I do not want to learn how to use Helix for development. I want to be able to continue using VSCode. And last I checked, the VSCode extension was not very good. I also use Vim keybindings in Obsidian.

The moment VSCode and Obsidian support improves, I am switching immediately.

  • I switched from VSCode to Zed, which has a helix mode built-in and it works very well. For Obsidian, I use markdown-oxide with helix and just use the Obsidian app as a viewer. A helix-mode for Obsidian would be sooo nice.