Top
Best
New

Posted by hggh 7 days ago

The vi family(lpar.ath0.com)
193 points | 119 commentspage 3
jgalt212 54 minutes ago|
> wondering why so many people would choose to use a fifty year old text editor with a notoriously steep initial learning curve

The alternative is just as steep, if not steeper.

rswail 3 hours ago||
I first used ed(1) back in the ye olden days of early 1980s, vi was like a major advance.

Came in handy when I had to talk a guy through updating a Solaris config file to allow the box to boot when he only had a serial console in the early 2000s.

classichasclass 7 hours ago||
Long ago I wrote my own really incomplete vi subset for the C64 that I really should dust off. But there's a more polished vi clone for 6502 machines, including the C64, Apple II and Atari: https://vi65.sourceforge.net/
kouosi 5 hours ago||
Hi you may want to include neatvi[0] and nextvi[1].

[0]: https://github.com/aligrudi/neatvi

[1]: https://github.com/kyx0r/nextvi

mechanicum 4 hours ago||
I think describing Kakoune/Helix as vi-inspired with “slightly different keybindings” is rather missing the point.

The most important difference is that they invert the editing model from verb-noun to noun-verb. Meaning you always see exactly what you’re going to be operating on before you do it.

The second most important difference is that they were designed from the ground up around multi-selection editing as a primitive, rather than a plugin or late addition.

That model is typically less efficient purely in terms of keystrokes, for some operations significantly so, but it’s somewhat mitigated if having the state on-screen rather than in your head means you undo less often.

I wouldn’t suggest either approach is superior. I suspect most people (“most people” in the subset of people who jibe with modal editing to begin with, anyway) will find that one just fits their brain better than the other.

Personally, even having used Vim almost daily since finding it on a Fish Disk sometime in the mid-90s, I still turned out to be in the kak/hx group. I can still use vi quite comfortably when I need to, but Helix removed a bit of friction I’d barely been aware of.

There’s a steady stream of NeoVim exiles to Helix forums, I think who mostly found its Lua-based config too complex/brittle, asking why the devs don’t add settings to make it work like Vim, include a *Vim keymap as standard, etc.

It’s kind of wild to me that people would choose their editor based on how minimalist its config/how batteries-included it is, rather than its fundamental editing paradigm.

mapcars 2 hours ago||
I wonder if people who stuck with vi(m) know about Xerox PARC, wysiwyg, gui and nomodes.
keyle 5 hours ago||
I didn't know about vim-classic, I've switched to it now. I can't really notice much of a difference except themes are missing... and fzf needed a fix.
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)

16bitvoid 6 hours ago||
Helix's selection-action feels way more natural to me than vi/vim's action-selection.
opan 5 hours ago||
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?

16bitvoid 1 hour ago|||
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.

rmunn 5 hours ago||||
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?

rbits 5 hours ago||||
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.

rmunn 5 hours ago|||
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.
rbits 5 hours ago||
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.

16bitvoid 1 hour ago||
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.
casey2 8 hours ago||
Sam isn't graphical there is sam and samterm which sends commands to sam. sam itself is an ed style line editor, where the concept of a line is replaced with a dot. vis allows multiple dots.

It's worth noting that a lot of the text editing done in the vi family are just calls to ed with different ways of doing selections.

yu3zhou4 4 hours ago|
There was onivim that was a bit hyped a few years ago but unfortunately it died
More comments...