If I'm editing two files with vim, changing to the other file ( :bnext, :bprev ) seems to drop the undo history from the open file - hitting the 'u' key reports "Already at oldest change".
For example:
vim testfile1 testfile2
- add some stuff to testfile1
:w
:bn
:bp
u
- eep! can't undo!
Is there any way to keep this history for non-visible buffers?
The newest version of vim (7.3) has persistent undo, so that you can make a change, close vim completely (even shutdown and restart), restart vim, and undo. In your
.vimrc
:Looks like this will do it:
(in .vimrc)
You can use Viewports.
"vim -o testfile1 testfile2" - open files in splitted window.
":sp filename" - split and open "filename".
":vsp filename" - vertical split and open "filename".
"Ctrl+w+arrow" - Change viewport.