When undoing you can press Ctrl-G to redo.
keyboard-quit which signals
However this isn't convenient because as far as I know you can't run commands after keyboard-quit.
Is there a more direct way to break the undo chain, or a way to run
keyboard-quit so you can keep calling functions after it?
I tried this for an undo/redo that doesn't require explicit Ctrl-G.
(defvar-local my-undo-is-redo nil) (defun my-redo () (interactive) (let ((inhibit-quit t)) (unless my-undo-is-redo (with-local-quit (keyboard-quit))) ;; redo continued... (undo) (setq my-undo-is-redo t))) (defun my-undo-only () (interactive) (undo-only) (setq my-undo-is-redo nil)) (define-key evil-normal-state-map (kbd "u") 'my-undo-only) (define-key evil-normal-state-map (kbd "C-r") 'my-redo)