On Mon, Jun 15, 2009 at 09:24:57AM +0200, Paul B. Mahol wrote: > On 6/15/09, Gary Kline <kl...@thought.org> wrote: > > > > > > the main reason i don't use vim is because of its [u]ndo > > command. as most of you can understand, there are a whole slew > > of times when i need to undo something. too often in vim, > > hitting 'u' --- sometimes > once accidentally --- has resulted in > > a small disaster. [[i have too many current/recent copies of > > my working files to do TOO much damage!]] Anyway, is there a > > means of setting the undo key to mimic vi/nvi? > > From vim help: > > 2. Two ways of undo *undo-two-ways* > > How undo and redo commands work depends on the 'u' flag in 'cpoptions'. > There is the Vim way ('u' excluded) and the vi-compatible way ('u' included). > In the Vim way, "uu" undoes two changes. In the Vi-compatible way, "uu" does > nothing (undoes an undo). > > 'u' excluded, the Vim way: > You can go back in time with the undo command. You can then go forward again > with the redo command. If you make a new change after the undo command, > the redo will not be possible anymore. > > 'u' included, the Vi-compatible way: > The undo command undoes the previous change, and also the previous undo > command. > The redo command repeats the previous undo command. It does NOT repeat a > change command, use "." for that. > > Examples Vim way Vi-compatible way ~ > "uu" two times undo no-op > "u CTRL-R" no-op two times undo > > 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. >
strange, but i just tested dwdw in the nvi that keith bostic gave us. it deletes 2 words. and if you type '.', it repeats the dw by deleting each word. no sense in getting into any 'religious war' over vim vs nvi. it may be what you're used to. i've been using vi for over 30 years and am used to its ease ... and its quirks. gary > > Anyway this topic is offtopic. > -- > Paul -- Gary Kline kl...@thought.org http://www.thought.org Public Service Unix http://jottings.thought.org http://transfinite.thought.org For FBSD list: http://transfinite.thought.org/slicejourney.php The 4.98a release of Jottings: http://jottings.thought.org/index.php _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"