简体   繁体   中英

Why does vim always say 'Already at oldest change' when I try to undo?

I couldn't find this problem asked about anywhere, so here it is for the next guy.

Somehow my vim, which is highly customized with tons of plugins far more complex than I care to debug, gets intermittently wedged in a state where if I hit 'u', it said 'Already at oldest change'. When I hit CTRL-R, it said 'Already at newest change'. But it wouldn't undo or redo anything.

Very frustrating.

This happens when undolevels is negative which is apparently used to keep vim undo from using up memory. For some reason my undolevels was set to -123456.

Set your undolevels to a big positive number like 999999 and everything will return to normal.

You may also want to check your .vim file trees and such, if you're using plugins and states that do this, to persist settings on a per file basis, that they don't have 'setlocal' undolevel settings inside them. I had to clear out several dozen such nefarious configurations.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM