From eb2557255f41b7615634e8dd6b81ad17e744acdc Mon Sep 17 00:00:00 2001 From: Peter Tillemans Date: Mon, 11 Nov 2024 17:10:55 +0100 Subject: [PATCH] add undo-tree package --- init.org | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/init.org b/init.org index ad5c3ce..3bfd40d 100644 --- a/init.org +++ b/init.org @@ -60,6 +60,10 @@ accident instead of the source in the org-mode file. Also immediately set lexical binding mode. ** Set the garbage collector threshold, to avoid collections +The emacs history goes back to times where memory was counted in +bytes, not gigabytes. We can afford to be a bit more generous with the +garbage collector settings. + #+begin_src emacs-lisp (setq gc-cons-percentage 0.5 gc-cons-threshold (* 128 1024 1024)) @@ -116,6 +120,31 @@ Needs to load early so the ~:general~ keyword is available for ~use-package~. #+END_SRC +*** Enable Undo Tree +undo-tree is my preferred way of undoing and redoing stuff. The main reason is it doesn’t create a linear undo/redo history, but rather a complete tree you can navigate to see your complete editing history. One of the two obvious things to do are to tell Emacs to save all its undo history fies in a dedicated directory, otherwise we’d risk littering all of our directories. The second thing is to simply globally enable its mode. + +(use-package undo-tree + :defer t + :straight (:build t) + :custom + (undo-tree-history-directory-alist + `(("." . ,(expand-file-name (file-name-as-directory "undo-tree-hist") + user-emacs-directory)))) + :init + (global-undo-tree-mode) + :config + <> + <> + (setq undo-tree-visualizer-diff t + undo-tree-auto-save-history t + undo-tree-enable-undo-in-region t + undo-limit (* 800 1024) + undo-strong-limit (* 12 1024 1024) + undo-outer-limit (* 128 1024 1024))) + + + + ** Utility Functions @@ -1128,12 +1157,6 @@ gicrisf has [[https://github.com/gicrisf/ox-zola][created a package]] to export #+END_SRC #+RESULTS: -<<<<<<< HEAD -: [nil 26302 34728 837190 nil elpaca-process-queues nil nil 651000 nil] -||||||| parent of 48b03fc (add the general package) -: [nil 26301 59789 776924 nil elpaca-process-queues nil nil 824000 nil] -======= ->>>>>>> 48b03fc (add the general package) It is a wrapper around ~ox-hugo~ to export org files to Zola. It supports most features of it and directs the user to the [[https://ox-hugo.scripter.co/][the hugo