From b51177bde839c0d9ce39c13dbf7c8e913a28000f Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sat, 12 Nov 2022 21:51:26 +0300 Subject: [PATCH] Switch to undo-fu and vundo, these are nicer --- .emacs.bankruptcy/init.org | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.emacs.bankruptcy/init.org b/.emacs.bankruptcy/init.org index 307851d..f67097c 100644 --- a/.emacs.bankruptcy/init.org +++ b/.emacs.bankruptcy/init.org @@ -721,14 +721,13 @@ startup. Reason we have to call this is so the vterm fucntion can call `vterm--i #+begin_src emacs-lisp (add-hook 'emacs-startup-hook (lambda () (require 'vterm))) #+end_src -** Undo Tree +** Undo Fu #+begin_src emacs-lisp -(straight-use-package 'undo-tree) - -(add-hook 'after-init-hook (lambda () - (global-undo-tree-mode) - (setq undo-tree-visualizer-diff t) - (setq undo-tree-history-directory-alist `(("." . ,(expand-file-name "undo" user-emacs-directory)))))) +(straight-use-package 'undo-fu) +(straight-use-package 'undo-fu-session) +(straight-use-package 'vundo) +(global-undo-fu-session-mode) +(setq undo-fu-session-incompatible-files '("/COMMIT_EDITMSG\\'" "/git-rebase-todo\\'")) #+end_src ** Text Editor @@ -774,7 +773,7 @@ Emacs is an great operating system, if only it had a good text editor... #+begin_src emacs-lisp (setq evil-want-keybinding nil) -(setq evil-undo-system 'undo-tree) +(setq evil-undo-system 'undo-fu) (setq evil-want-C-u-scroll t) (setq evil-want-Y-yank-to-eol t) (setq evil-disable-insert-state-bindings t) @@ -788,6 +787,7 @@ Emacs is an great operating system, if only it had a good text editor... ;; TODO: We need 3 bindings; 1.) close buffer 2.) close window 3.) close buffer and window ;; To disable a keybinding just bind it to nil (evil-set-leader 'normal (kbd "SPC")) + (evil-define-key 'normal 'global (kbd "w") 'save-buffer) (evil-define-key 'normal 'global (kbd "q") 'kill-buffer-and-window) (evil-define-key 'normal 'global (kbd "k") 'kill-this-buffer) @@ -858,7 +858,6 @@ Emacs is an great operating system, if only it had a good text editor... (setq evil-goggles-duration 0.075) (setq evil-goggles-pulse t) (setq evil-goggles-async-duration 0.55) - #+end_src ** Which Key