help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: make undo operate as in (no flames please) vim


From: Drew Adams
Subject: RE: make undo operate as in (no flames please) vim
Date: Sun, 25 Jan 2009 09:02:38 -0800

> You've hit on one of the reasons I had grown to dread using undo. 
> 
> I resorted to the prefix arg to eliminate possibly dozens of C-x u
> presses which inevitably would lead sooner or later to hitting
> `C-x-u', the dread upcase-region that totally disrupts the work flow.
> And, like you guessed... there'd come a point where I'd have to figure
> out if I'd passed the goal, and by then it wasn't unlikely that I'd be
> somewhat confused about what was or wasn't undone.... Then the whole
> thing with arrow keys to indicate which way to go with undo can get
> pretty confusing too.

Dunno what you mean by "the thing with arrow keys". Maybe that is something new
that I am unaware of.

The general rule is that undo just undoes. Including undoing what it itself did.
That means that to seemingly go backwards you need only do something other than
undo, then start doing undo again.

Example: C-/ C-/ C-/ SPC C-/ C-/

Hitting the space bar (or some other key, such as an arrow key) stops undoing.
Then hitting C-/ again undoes the space char insertion and starts undoing the
undo's that you did previously.

In this way, you can seemingly go backwards and forwards, like rewinding a
movie. You are not actually rewinding it, however: everything you do is added to
the undo chain. It's just that the undo chain then itself has back and forth
actions.

That's not a clear explanation - sorry. But if you try it you'll see what I
mean, I think.

This page might also help:
http://www.emacswiki.org/emacs/CategoryUndo

> Now if only I can break the ingrained habit of using C-x u.... 

;-)

And I do hope someone helps you find the Vim-like behavior you really want.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]