Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jun 2009 19:12:01 +0300
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Gary Kline <kline@thought.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: vim question...
Message-ID:  <87fxe179ym.fsf@kobe.laptop>
In-Reply-To: <20090615024643.GA33420@thought.org> (Gary Kline's message of "Sun, 14 Jun 2009 19:46:45 -0700")
References:  <20090615024643.GA33420@thought.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 14 Jun 2009 19:46:45 -0700, 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?

Hi Gary,

If you accidentally type 'u' in vim, you can "redo" it by ^R.  There is
also the "set compatible" option, but it isn't exactly "compatible" with
the nvi behavior.

In nvi, typing 'u' can undo the last operation.  Then repeating the undo
command with '.' keeps undoing changes until the buffer is reverted to
its original state.

In vim, with "set compatible" enabled", typing 'u' repeatedly toggles
between the last two states of the buffer.  In "compatible" mode I am
not sure of how to undo multiple changes.  In "set nocompatible" mode,
typing 'u' repeatedly undoes multiple changes, and typing '^R' multiple
times redoes them.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?87fxe179ym.fsf>