From 58fc99cf8c93a4443b96a8169b578363eb35e406 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Thu, 20 Jun 2024 18:41:32 +0200 Subject: [PATCH] docs(emacs): remove undo-tree --- docs/emacs/keybinding-managers.org | 47 ------------------------------ docs/emacs/keybindings.org | 1 - 2 files changed, 48 deletions(-) diff --git a/docs/emacs/keybinding-managers.org b/docs/emacs/keybinding-managers.org index 03397a6..ee7f98a 100644 --- a/docs/emacs/keybinding-managers.org +++ b/docs/emacs/keybinding-managers.org @@ -68,7 +68,6 @@ they are much more comfortable than Emacs’. evil-want-C-u-scroll t evil-want-C-i-jump nil) (require 'evil-vars) - (evil-set-undo-system 'undo-tree) :config <> <> @@ -156,52 +155,6 @@ additional code compared to most people due to the bépo layout. (evil-collection-init)) #+end_src -~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 files in a dedicated directory, otherwise we’d risk -littering all of our directories. The second thing is to simply -globally enable its mode. -#+begin_src emacs-lisp -(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-visualizer-timestamps 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))) -#+end_src - -An interesting behaviour from DoomEmacs is to compress the history -files with ~zstd~ when it is present on the system. Not only do we enjoy -much smaller files (according to DoomEmacs, we get something like 80% -file savings), Emacs can load them much faster than the regular files. -Sure, it uses more CPU time uncompressing these files, but it’s -insignificant, and it’s still faster than loading a heavier file. -#+name: undo-tree-compress-files -#+begin_src emacs-lisp :tangle no -(when (executable-find "zstd") - (defun my/undo-tree-append-zst-to-filename (filename) - "Append .zst to the FILENAME in order to compress it." - (concat filename ".zst")) - (advice-add 'undo-tree-make-history-save-file-name - :filter-return - #'my/undo-tree-append-zst-to-filename)) -#+end_src - ** Hydra [[https://github.com/abo-abo/hydra][Hydra]] is a simple menu creator for keybindings. #+begin_src emacs-lisp diff --git a/docs/emacs/keybindings.org b/docs/emacs/keybindings.org index db28969..370a781 100644 --- a/docs/emacs/keybindings.org +++ b/docs/emacs/keybindings.org @@ -62,7 +62,6 @@ Undefining some stuff to make keybind prefixes work correctly. "'" '(shell-pop :package shell-pop) "R" #'recompile "u" #'universal-argument - "U" '(undo-tree-visualize :package undo-tree) <> <>