When I open another file in a Vim session all editing history for the other files disappears.
Is it possible to configure Vim that it would automatically save and restore file editing history when hopping through files?
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.
Sign up to join this communityWhat I do is add the following to my .vimrc
:
set undofile
set undodir=~/.vim/undo/
That way all your undo/change tree information is saved across vim sessions, and next time you open your file you can still undo/redo old edits.
gvim
andvim
are the same program. Just the UI is different.’undofile’
isn’t required to fix this: setting'hidden'
will suffice.