From: Janis Papanagnou on 8 Apr 2010 13:59 Seebs schrieb: > On 2010-04-08, Chris Ahlstrom <ahlstromc(a)launchmodem.com> wrote: >> You can set tildeop in vim, also. > > Ooh! Now if only it had the other stuff I'm used to. (In particular, I'd > kill for a setting for "do infinite undo the way nvi does", because I find > that more intuitive.) Curious; how is nvi's "infinite" undo different from, say, vim's? Janis
From: Seebs on 8 Apr 2010 14:11 On 2010-04-08, Janis Papanagnou <janis_papanagnou(a)hotmail.com> wrote: > Seebs schrieb: >> On 2010-04-08, Chris Ahlstrom <ahlstromc(a)launchmodem.com> wrote: >>> You can set tildeop in vim, also. >> >> Ooh! Now if only it had the other stuff I'm used to. (In particular, I'd >> kill for a setting for "do infinite undo the way nvi does", because I find >> that more intuitive.) > Curious; how is nvi's "infinite" undo different from, say, vim's? In nvi, hitting 'u' repeatedly toggles the last change, as it does in regular vi. The usage is: u => undo (or redo if you just did an undo) .. after u => continue in that direction through the undo/redo stack .. after moving => redo last change This aligns nicely with the keyboard habits you pick up from classic vi; you would never use '.' to undo an undo, only to make the same change somewhere else, so if you don't know about it, you're unlikely to ever encounter it, but if you do use it, it behaves in a straightforward manner. 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.) -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 8 Apr 2010 16:05 Seebs schrieb: > On 2010-04-08, Janis Papanagnou <janis_papanagnou(a)hotmail.com> wrote: >> Seebs schrieb: >>> On 2010-04-08, Chris Ahlstrom <ahlstromc(a)launchmodem.com> wrote: >>>> You can set tildeop in vim, also. >>> Ooh! Now if only it had the other stuff I'm used to. (In particular, I'd >>> kill for a setting for "do infinite undo the way nvi does", because I find >>> that more intuitive.) > >> Curious; how is nvi's "infinite" undo different from, say, vim's? > > In nvi, hitting 'u' repeatedly toggles the last change, as it does in > regular vi. The usage is: > > u => undo (or redo if you just did an undo) Okay, this is old vi's behaviour. > . after u => continue in that direction through the undo/redo stack > . after moving => redo last change 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. > This aligns nicely with the keyboard habits you pick up from classic vi; > you would never use '.' to undo an undo, only to make the same change > somewhere else, so if you don't know about it, you're unlikely to ever > encounter it, but if you do use it, it behaves in a straightforward manner. > > 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.) 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. BTW, in vim you've in addition identifying messages for undo's (if you like this information), like: "1 change; before #112 1 seconds ago". Janis
From: Antony Scriven on 8 Apr 2010 16:14 On Apr 8, 7:11 pm, Seebs 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.) Vim has undo branches. It also has wonderful commands such as `:earlier 5m' which will revert the buffer to how it was 5 minutes ago. --Antony
From: Christian Brabandt on 8 Apr 2010 16:42 On 2010-04-08, Seebs <usenet-nospam(a)seebs.net> wrote: > In nvi, hitting 'u' repeatedly toggles the last change, as it does in > regular vi. The usage is: > > u => undo (or redo if you just did an undo) > . after u => continue in that direction through the undo/redo stack > . after moving => redo last change Was this really the case for plain old vi? I remember when using vi on AIX (or was it Solaris?) that an . after u did not go through the undo/redo stack. Looking at SUSv3 indicates, that the . should not repeat the latest u command. And vim's help states at :h undo-two-ways (scrolling to the end of the paragraph): [�] Rationale: Nvi uses the "." command instead of CTRL-R. Unfortunately, this is not Vi compatible. For example "dwdwu." in Vi deletes two words, in Nvi it does nothing. [�] > This aligns nicely with the keyboard habits you pick up from classic > vi; you would never use '.' to undo an undo, only to make the same > change somewhere else, so if you don't know about it, you're unlikely > to ever encounter it, but if you do use it, it behaves in a > straightforward manner. > > 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.) Yes. This happens to me too. The undo-branches (:h undo-branch) are confusing and awkward to use. You might find my plugin histwin http://www.vim.org/scripts/script.php?script_id=2932 helpful for browsing the undo-tree. regards, Christian
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 5 Prev: very strange ksh behavior Next: problems with loop in bash |