spacemacs
spacemacs copied to clipboard
Restore emacs' default undo/redo behavior in spacemacs
I've recently moved to spacemacs and it seems that they've adopted a different undo package (undo-tree) which I don't like since it does not push the undo actions back onto the history stack. I would like to restore the default behavior but I can't seem to figure out how to do this.
C-/ is bound to undo-tree-undo in spacemacs. I've tried to unbind this and use emacs' undo instead, but that does't seem to work. I've added the following in my user-config.el:
(global-unset-key (kbd "C-/"))
(global-set-key (kbd "C-/") 'undo)
But the key remains bound to the undo-tree method. I've also tried bind it to a new key, but the same seems to happen. It's as if spacemacs redirects call to for undo to undo-tree-undo. Is there anyway to fix this? Thank you.
It seems to work to restore the default undo
:
C-/ ;; undo
By adding:
(global-undo-tree-mode -1)
to the dotspacemacs/user-config
section in .spacemacs
.
.spacemacs
can be opened by pressing SPC f e d
(or with the Emacs key bindings: M-m f e d
)
I was able to get this working on emacs28 with:
(global-undo-tree-mode -1)
(evil-set-undo-system 'undo-redo)
Without the 2nd, undo wouldn't work. This requires emacs28 off git, since undo-redo
is a new built-in, but it already has native support in evil-undo
now!
I've only been using this for an hour or two, but so far it seems dramatically faster. I wonder if we should promote this as a first-class choice in spacemacs?
@oneself Please try the workaround by @bhipple https://github.com/syl20bnr/spacemacs/issues/14406#issuecomment-851597233
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!