practicalli / spacemacs

Content for the book - Clojure Development with Spacemacs
https://practical.li/spacemacs
Creative Commons Attribution Share Alike 4.0 International
109 stars 33 forks source link

Replace / disable undo tree #267

Open practicalli-johnny opened 3 years ago

practicalli-johnny commented 3 years ago

Some people have reported undo-tree causing Emacs lock-up with the only option being to kill emacs.

Practicalli is using undo tree without issue.

An alternative is to disable undo-tree in Spacemacs (is it possible to exclude undo-tree ?) and use undu-fu

undo-fu has some basic features basic and may forget the undo history and only go back a few steps, so not a like for like replacement

Edit the Spacesmacs configuration file:

  (global-undo-tree-mode nil)
  (define-key evil-normal-state-map "u" #'undo-fu-only-undo)
  (define-key evil-normal-state-map "\C-r" #'undo-fu-only-redo)

Add undo-fu to dotspacemacs-additional-packages

goodevilgenius commented 2 years ago

Thanks for this. I've been having serious issues for the past couple weeks in spacemacs, where saves and undos would take about 30 - 60 seconds every time.

I finally tracked it down to undo-tree. This helped me figure out how to disable it. I don't need any of that advanced stuff. Just a simple undo and redo is all I needed.

I did

(global-undo-tree-mode nil)

instead of -1. That worked for me.

gnujesus commented 1 year ago

Seriously thank you. I recently wanted to try vim/neovim and switch from VScode to Emacs since I heard it was a good choice as a text editor, but I was having this issue when I installed spacemacs and first opened it. I just pasted the whole thing and it worked. Thank you!

catern commented 1 year ago

Emacs 28 has undo-redo built in, so undo-fu is no longer necessary. Instead, you can do the following (untested):

(global-undo-tree-mode -1)
(setq evil-undo-system 'undo-redo)
(evil-set-undo-system 'undo-redo)

(If you want the undo-tree visualization, try the "vundo" package)

(As a bonus, the built-in Emacs undo system has a very unique and powerful feature, which undo-tree and undo-fu do not have: if you mark a region and undo, it will only undo changes in that region)