Comment by bch
4 days ago
> can’t remember ever meeting anyone who chose vi over vim
Pleased to meet you.
Most of my console dev time is spent in *BSD, where nvi is where I land. I find the the default creature-features of vim annoying, so I end up having to configure it to be a bit more quiet, and I don't know anything so compelling about it (a vi clone (to an extreme, acknowledged)) that nvi isn't a good enough place to be. I have vim installed, but it's not my go-to.
> I don't know anything so compelling about it
For me, it'd be primarily having more than one undo. Not being able to undo the second-to-last change is pretty bad. In fact, vim's undo being set up as a tree that can be walked with g- and g+ is excellent. It's impossible to lose a state of the buffer, even if you undo and make changes. It's a lot more practical to navigate than Emacs' undo, too.
EDIT: I just realized that nvi can undo more than one change by having u toggle the direction and . continue in that direction. I don't think ex-vi could. busybox vi seems like it can undo multiple with u but it seems to have no redo.
> It's a lot more practical to navigate than Emacs' undo, too.
What the heck are you talking about?
Emacs undo is simply the State monad over a zipper into a persistent tree of buffer states.
I can't see how you could make it more practical?
> For me, it'd be primarily having more than one undo
Do you mean infinite undo? nvi has that. I'm not sure what you mean "set up as a tree" wrt undo, but i'll look into it. I think of nvi's undo as linear - I can 'u' to "undo" and implicitly set my "undo direction" "backward in time" (as one would expect). If I want to "undo, even more", '.' (dot, period) to "do that last command again" is what I'll do. If I want to "undo an undo", 'u'. That has the effect of moving the "undo direction" back towards the state of the buffer we had at the beginning of our discussion here.
...and, now I see your edit ;)
^[u..........:wq
> I'm not sure what you mean "set up as a tree" wrt undo
:h undo-branches
There's also a plugin to show a visualization of the tree, but the tree is implemented within vim.
https://github.com/mbbill/undotree
1 reply →
The only times I encounter vi (and so not sure what version, but likely barebones Linux), it doesn't indicate whether you are in insert or normal mode. So I immediately install vim (once possible).
Is that something you just get used to, or was I using some weird vi?
I always assume I am in normal mode unless I am actively typing. If I stop to think I ESC. Then, when I gave thought, I know what I need to do next.
So for me there isn't really any time of looking at the screen and not knowing. And if there ever was some ambiguity I would reflexively hit ESC to get to a known state.
So, not sure it would bother me. But my editor does give me an indication of whether I am in normal, insert, visual, visual block, or Emacs mode.