From 921903401ee4760317033445210454c2a087ddc4 Mon Sep 17 00:00:00 2001 From: Jessie Hildebrandt Date: Tue, 20 Dec 2022 18:26:12 -0500 Subject: [PATCH] Replace undo-tree with vundo and undo-fu-session --- init.el | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/init.el b/init.el index f58463f..c1b0f17 100644 --- a/init.el +++ b/init.el @@ -1291,26 +1291,24 @@ DOCSTRING is an optional form that is discarded upon expansion." :custom (solaire-mode-real-buffer-fn (lambda () (and (buffer-name (buffer-base-buffer)) - (not (string-equal major-mode "neotree-mode")) + (not (derived-mode-p 'neotree-mode)) (not (string-match "\*Echo Area" (buffer-name (buffer-base-buffer))))))) :hook (server-after-make-frame-hook . solaire-global-mode) (emacs-startup-hook . solaire-global-mode)) ;; ---------------------------------- ;; -;; undo-tree +;; undo-fu-session ;; ---------------------------------- ;; -(defconst user/undo-tree-directory (locate-user-emacs-file "undo-tree/") "Location of undo-tree backup directory.") +(defconst user/undo-history-directory (locate-user-emacs-file "undo-history/") "Location of undo-fu-session history backups.") -(external-package undo-tree - "Visualizes undo history as a tree in an interactive buffer" +(external-package undo-fu-session + "Saves and recovers undo history of files between editing sessions" :config - (global-undo-tree-mode) + (global-undo-fu-session-mode) :custom - (undo-tree-enable-undo-in-region t "Enable undoing changes local to the active region.") - :custom - (undo-tree-history-directory-alist `(("." . ,user/undo-tree-directory)))) + (undo-fu-session-directory user/undo-history-directory "Set custom undo history storage location")) ;; ---------------------------------- ;; ;; vertico @@ -1334,6 +1332,20 @@ DOCSTRING is an optional form that is discarded upon expansion." ("\d" . vertico-directory-delete-char) ("\M-\d" . vertico-directory-delete-word))) +;; ---------------------------------- ;; +;; vundo +;; ---------------------------------- ;; + +(external-package vundo + "Visualizes undo history as a tree in an interactive buffer" + :custom + (vundo-glyph-alist vundo-unicode-symbols "Visualize undo history with pretty unicode symbols") + :hook + (vundo-mode-hook . (lambda () + (setq-local global-hl-line-mode nil))) + :bind + ("C-x u" . vundo)) + ;; ---------------------------------- ;; ;; writeroom-mode ;; ---------------------------------- ;;