This article says that "Emacs has redo because you can reverse direction while undoing, thereby undoing the undo".
What does this mean? How can a user 'redo' with Emacs?
This article says that "Emacs has redo because you can reverse direction while undoing, thereby undoing the undo".
What does this mean? How can a user 'redo' with Emacs?
Emacs 28 adds a redo command (called undo-redo).
If you want to have more typical undo/redo, the following commands can be used.
(global-set-key (kbd "C-z") 'undo-only)
(global-set-key (kbd "C-S-z") 'undo-redo)
To access this functionality (with the ability to use non-linear history too, see undo-fu which is a thin wrapper on emacs built in undo).
By default, redo in Emacs requires pressing C-g, then undo.
However it's possible use Emacs built-in undo to implement a redo command too.
The package undo-fu, uses Emacs built-in undo functionality to expose both undo and redo.
Edit, undo-fu has now been integrated into evil-mode (if you're an evil-mode user).
Example:
(use-package undo-fu)
(use-package evil
:init
(setq evil-undo-system 'undo-fu))
Doom Emacs users, I hope you've scrolled this far or searched for 'doom' on the page...
C-g C-/ C-/ C-/ etc (or C-g C-_ C-_ C-_ etc)
...and instead that just keeps undoing.S-C-/ (AKA C-?)
...and instead that throws the error "C-? is not defined".What you need is:
C-z to toggle in and out of evil-mode) (in evil-mode should see blue cursor, not orange cursor) andEsc to switch to command mode) (should see block cursor, not line cursor), and then it'su for undo andC-r for redo