From: Janis Papanagnou on
Seebs schrieb:
> On 2010-04-08, Janis Papanagnou <janis_papanagnou(a)hotmail.com> wrote:
>> This is behaviour you have as well in vim, though with other keys of
>> course; <U> (undo) goes back in the chain and <ctrl-R> (redo) goes up
>> the chain. There seems really no need (besides being used to old vi's
>> behaviour, and reluctance to switch) for the special case of toggling.
>
> The problem is that, in vim, if I try to use 'uu', Something Unexpected
> Happens.

Only unexpected if you're mentally unable to mentally move (no offense
intended). I've been using plain old vi since more that 25 years ago.
The restriction of vi's overly primitive undo had always, to me, been
unsatisfactory.[*] There are two ways (at least) to solve that problem;
add a second sophisticated undo function, thus supporting parallel
"universes", or just fix the existing one with a sophisticated function.

[*] This primitive form is still implemented in Kornshells vi based line
editing. (Just mention that to make the thread still appropriate for the
two crossposted newsgroups ;-)

> Without having been told about "ctrl-R", I had no way of recovering.

Now you've been told about <ctrl-R>. :-)

> nvi's solution satisfies the principle of least astonishment;
> if you don't do something that you would never do in normal usage in
> old vi, it works identically.

(You can set vim to be compatible to vi, but I'd really suggest you to
try to switch; have a look into vim's commands overview.)

>> If there's something special in nvi I probably just don't understand
>> your description. In vim you can go up and down in the undo chain as
>> well. IMO there's no need for an additional <U> <U> toggling when you
>> have <U> <ctrl-R> as the general case available. But YMMV, of course.
>
> I assume you mean "u", not "U" here?

In <...> brackets I meant the _key_ labelled U, resp. the key labelled R
while holding the key labelled Ctrl down. Sorry for having used confusing
syntax.

Janis

> [...]
From: Seebs on
On 2010-04-08, Janis Papanagnou <janis_papanagnou(a)hotmail.com> wrote:
> Only unexpected if you're mentally unable to mentally move (no offense
> intended).

I've had the habits for a long time -- and since I migrated to infinite
undo on BSD systems, I picked up the nvi habits, so I've been using them
for something like 15-20 years now. And I just plain like them better;
they fit my expectations better.

>> Without having been told about "ctrl-R", I had no way of recovering.

> Now you've been told about <ctrl-R>. :-)

Yup.

>> nvi's solution satisfies the principle of least astonishment;
>> if you don't do something that you would never do in normal usage in
>> old vi, it works identically.

> (You can set vim to be compatible to vi, but I'd really suggest you to
> try to switch; have a look into vim's commands overview.)

What I want, though, is not "compatible with vi", but "logically consistent
with the way vi did things". That's a subtle difference. I want something
that continues to act in ways *consistent with* my previous model.

I think some of it is just a massive gap in desired functionality. Much
of what vim does (e.g., automatically switching to other line endings,
which are usually not what I want) just doesn't match my preferences or
expectations. Yes, I can eventually configure it to turn off all the stuff
I don't like, but it's thus far been more pleasant for me to just use nvi.

> In <...> brackets I meant the _key_ labelled U, resp. the key labelled R
> while holding the key labelled Ctrl down. Sorry for having used confusing
> syntax.

No worries. I figured it out after re-reading.

-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam(a)seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
From: Janis Papanagnou on
Seebs schrieb:
>
> [...], but it's thus far been more pleasant for me to just use nvi.

Sure. So there's no more to tell about all those vi clone features.

Janis
From: Alan Curry on
In article <slrnhrs72e.q6b.usenet-nospam(a)guild.seebs.net>,
Seebs <usenet-nospam(a)seebs.net> wrote:
|
|In particular, vim's infinite-undo seems to me to be very good at getting into
|states where there is no obvious way for me to get back to "where I just was
|three keystrokes ago", while with nvi, I can always go up and down the chain
|freely. (If I have moved, and want to go back into the undo stack, 'u'
|undoes the last change, after which I can then move up and down it as I
|please.)

As long as all you have is an undo stack, it will be easy to cause this
problem. The full set of states that you can go through with arbitrary
undo/redo is not linear like a stack. It's a tree. vim gives you access to
the whole tree! I don't know how you'd get access to "sibling" branches of
the tree in nvi.

Example: start with an empty file. Add some text with an insert command. Call
this State 1.

Run all over it, changing letters here and there, to create a nice long chain
of states in the undo stack/tree. At the end of that you have an alternate
version, call it State 2.

Now you decide you want another look at the original text (State 1), so hit
"u......." until the file is empty again (back at the beginning), then hit
"u" once more to get back the originally inserted text.

Now you decide you liked the version after all the changes so you want to
redo them. And here's the part that happened to me too often: accidentally
bump the "o" key, or the "s" key... now you've made a change and created a
new state that's a child of State 1, and State 2 isn't on the linear path
reachable with "u" and "." (or "u" and "^R" in vim) any more.

The undo tree solves that problem.

--
Alan Curry
From: Seebs on
On 2010-04-09, Alan Curry <pacman(a)kosh.dhis.org> wrote:
> As long as all you have is an undo stack, it will be easy to cause this
> problem. The full set of states that you can go through with arbitrary
> undo/redo is not linear like a stack. It's a tree. vim gives you access to
> the whole tree! I don't know how you'd get access to "sibling" branches of
> the tree in nvi.

I don't think you would. I've never tried to, though.

> Now you decide you liked the version after all the changes so you want to
> redo them. And here's the part that happened to me too often: accidentally
> bump the "o" key, or the "s" key... now you've made a change and created a
> new state that's a child of State 1, and State 2 isn't on the linear path
> reachable with "u" and "." (or "u" and "^R" in vim) any more.

Ahhh.

Yeah, I can see how that'd be an issue, I guess. It hasn't bitten me that
I remember.

-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam(a)seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!