I really appreciate the undo in region command in standard emacs, where you can just mark a region and only changes made in that region are undone.
This doesn't seem to work in the default spacemacs configuration.
Is there a way to activate this?
I really appreciate the undo in region command in standard emacs, where you can just mark a region and only changes made in that region are undone.
This doesn't seem to work in the default spacemacs configuration.
Is there a way to activate this?
(define-key evil-visual-state-map (kbd "u") 'undo)
It will bind u to Emacs undo command in evil visual state (aka when you select region).
You can select the region and do, either:
SPC SPC undo
or
C-_
that is Control-shift-
-key
or even better, you can create your own keymap under SPC o
that's reserved for user keybindings, and create SPC o u
for undo
:
(spacemacs/declare-prefix "o" "personal")
;; File bindings
(spacemacs/set-leader-keys
"ou" 'undo)
As of July 15, 2022, there exists a flag to enable undo-region
with vim style key bindings in the Spacemacs develop -- which also happens to currently be the default, rolling release -- branch. Users can edit the .spacemacs
file to include the following,
(setq-default dotspacemacs-configuration-layers
'((spacemacs-editing :variables
vim-style-enable-undo-region t)))
For the related git pull request, see https://github.com/syl20bnr/spacemacs/pull/15631