Date: Mon, 15 Jun 2009 23:41:34 +0200 From: "Paul B. Mahol" <onemda@gmail.com> To: Gary Kline <kline@thought.org> Cc: FreeBSD Mailing List <freebsd-questions@freebsd.org> Subject: Re: vim question... Message-ID: <3a142e750906151441p6a9db819r1b9da3f82dd48097@mail.gmail.com> In-Reply-To: <20090615203055.GB37102@thought.org> References: <20090615024643.GA33420@thought.org> <3a142e750906150024v2936759amd5229ccbb2a71daf@mail.gmail.com> <20090615203055.GB37102@thought.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 6/15/09, Gary Kline <kline@thought.org> wrote: > On Mon, Jun 15, 2009 at 09:24:57AM +0200, Paul B. Mahol wrote: >> On 6/15/09, Gary Kline <kline@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. Nvi is not Vi, and Vim is not Nvi clone. > gary > > >> >> Anyway this topic is offtopic. >> -- >> Paul > > -- > Gary Kline kline@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 > > -- Paul
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3a142e750906151441p6a9db819r1b9da3f82dd48097>