Forcing the use of undo-fu

This commit is contained in:
Howard Abrams 2022-03-25 11:01:04 -07:00
parent d03bfed2cb
commit 2aa2886535

View file

@ -324,11 +324,16 @@ Why would I ever quit Emacs with a simple keybinding? Lets override it:
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(global-set-key (kbd "s-q") 'bury-buffer) (global-set-key (kbd "s-q") 'bury-buffer)
#+END_SRC #+END_SRC
*** Undo-Fu *** Undo
Configure the Evil session to use [[https://gitlab.com/ideasman42/emacs-undo-fu][undo-fu]], as this project is now maintained. I mean, I /always/ use ~C-/~ for [[help:undo][undo]] (and ~C-?~ for [[help:undo-redo][redo]]), but since Im on the Mac quite a bit, I want to cover my bases.
Why use [[https://gitlab.com/ideasman42/emacs-undo-fu][undo-fu]] instead of the built-in undo functionality? Well, there isnt much to the project (thats a good thing), but It basically doesnt /cycle/ around the redo, which annoying.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package undo-fu (use-package undo-fu
:config :config
(global-set-key [remap undo] 'undo-fu-only-undo)
(global-set-key [remap undo-redo] 'undo-fu-only-redo)
(global-unset-key (kbd "s-z")) (global-unset-key (kbd "s-z"))
(global-set-key (kbd "s-z") 'undo-fu-only-undo) (global-set-key (kbd "s-z") 'undo-fu-only-undo)
(global-set-key (kbd "s-S-z") 'undo-fu-only-redo)) (global-set-key (kbd "s-S-z") 'undo-fu-only-redo))