Frage

I like how I can undo multiple times with ctrl+_, but I can't seem to figure out how to redo that supports multiple times with a similar quick shortcut.

Also, I can't seem to figure out how to skip multiple lines up and down at once.

War es hilfreich?

Lösung 2

I can't seem to figure out how to redo that supports multiple times with a similar quick shortcut.

Sorry if you know this...

You can switch undo to redo by hitting C-g once. So it is not one shortcut key. The behavior is not like as ordinary editor. But I think it is very quick way of redo. See the behavior below.

Emacs undo state changes:

----example1------
time |typed |text
-----+------+-----
1    |      |''
2    |'a'   |'a'
3    |'b'   |'ab'
4    |'c'   |'abc'
5    |'d'   |'abcd'
6    |udno  |'abc'
7    |undo  |'ab'
8    |undo  |'a'
9    |undo  |''
10   |C-g   |''     <---switch
11   |undo  |'a'    <---redo!
12   |undo  |'ab'   <---redo!
13   |undo  |'abc'  <---redo!
14   |undo  |'abcd' <---redo!

----example2------
time |typed |text
-----+------+-----
1    |      |''
2    |'a'   |'a'
3    |'b'   |'ab'
4    |'c'   |'abc'
5    |'d'   |'abcd'
6    |udno  |'abc'
7    |undo  |'ab'
8    |undo  |'a'
9    |undo  |''
10   |C-g   |''    <---switch
11   |undo  |'a'   <---redo!
12   |undo  |'ab'  <---redo!
13   |'x'   |'abx' <---switch
14   |undo  |'ab'
15   |undo  |'a'
16   |C-g   |'a'   <---switch
17   |undo  |'ab'  <---redo!!
18   |undo  |'abx' <---redo!!

Andere Tipps

Vanilla Emacs undo has no associated redo. You can find various redos out there -- start at EmacsWiki, for example.

However, you might just prefer, as many of us do, what ordinary Emacs undo has to offer. In a nutshell, it records like a film, which means that if you exit it (stop undoing) and then you start undoing again, you undo what you just undid! You can go "back and forth" like this, as far as you like.

You don't really go forwards (redo) that way, however: you just keep undoing. And undoing undoing has a similar effect to redoing. If you go too far, just quit undoing and start over. (Hit any other key, e.g. RET, to quit undoing.)

See also various wiki pages about undo, including UndoTree.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top