

The full undo history is still accessible using “Unconstrained” undo/redo, accessed by pressing Ctrl-G before undo or redo which behave much the same as the default ‘undo’ command.

However, unlike undo in most editors, a single edit after undoing doesn’t remove all edits. See Making Emacs Work the Way You Want at the end of this chapter for information on CUA mode. This allows you to hold the undo-key to reach an earlier part of the document, then hold the redo-key to go back to the state where undo was initiated. Usageīy default the commands undo-fu-only-undo & undo-fu-only-redo perform undo and redo as you would expect in a word-processor for example. WWE legend Ric Flair on Vince McMahon ordering him to redo a match Britney Spears and Christina Aguilera s Longtime. But I didn't know this is built-in into emacs 28. So far I just used undo-fu, which implements something a simple undo-redo functionality on top of emacs' undo system. This package uses Emacs built-in undo, avoiding any incompatibility or complications that can arise when manipulating undo history, adding commands for more typical undo/redo functionality. (global-set-key (kbd 'C-/') 'undo-only) (global-set-key (kbd 'C-') 'undo-redo) Can't be bothered with that shit, this will do. While this can be useful, it complicates navigating the undo-history, especially in situations where a simple undo/redo commands are sufficient. When in the normal mode ( modalka-mode) with such a setup, two lines of text can be killed like this: SPC n n w. Having once undone a change with ‘C-x u’ or C-’ or ‘C-/’, you can repeat the undo command by pressing ‘C-x z’, which is ‘repeat’. You can control how many it keeps by customizing option ‘undo-limit’. Emacs’s undo system allows you to recover any past state of a buffer. By default, Emacs keeps only a few dozen undo entries.
