0

I am using (evil-visual-block) and after the block selection pressing capital letter I and then typing what I want and pressing Esc when I am OK.

Now, I see there is a mistake. How to quickly undo everything? Because now when I press the key u for undo it removes only one letter. And when I changed 20 rows it will take forever to change it all.

Now I have to do again a block selection and delete it if I want to go back.

But it would be so much better to be able to undo the whole operation with one undo.

Any idea how to do that?

I am using Spacemacs, so if there is something there like that already it would be even better.

fegax
  • 97
  • 1
  • 7

1 Answers1

0

In Evil, the u key is used to undo the last change. To undo multiple changes, you can use the C-u prefix before the u key. For example, pressing C-u u will undo the last four changes. You can use a larger prefix value to undo more changes at once.

Alternatively, you can use the evil-undo command, which is bound to the U key in Evil, to undo all changes on a single line. This command will undo all changes on the current line, but it will not undo changes on other lines.

If you want to undo all changes in a block of text, you can use the evil-undo-all command, which is bound to the C-u U key combination in Evil. This command will undo all changes in the current block of text, so you can use it to quickly undo all changes in a block that you have selected with evil-visual-block.

Arthur叔
  • 30
  • 2