1

I've recently started using SpaceVim which is basically vim that comes with some extra plugins and pre-done configurations. However, it has a default behavior that bothers me... It remembers changes after closing the file. That means that if I press u after reopening the file I end up erasing changes that I was working on a different day. The behavior is the following:

enter image description here

While the text was disappearing I was pressing u... Is there any variable I can configure in vim to reverse this behavior?

1
  • 1
    you want to disable persistent undo files. Read about it at :h 'undofile' May 23 at 6:00

2 Answers 2

2

The setting to use to preserve the undo is: set undofile

To disable undo file: set noundofile

2

Not a direct question to "how can I disable this feature", but my little undofile_warn.vim plugin will show a warning before undoing changing from previous Vim instances, which should also solve your problem, while retaining this (IMO useful) functionality.

Also see: Can I be notified when I'm undoing changes from the undofile?, which also has some other solutions, but my plugin has been working well for me personally for the last 7 years.

But if you want to disable it altogether you can use set noundofile, as Vivian's answer already mentions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.