I have undodir=~/.vim/undodir
such that persistent-undo history files don't clutter my source code directories.
However, for one particular source file, I'd like to have its persistent-undo history file to be stored in the same directory as the source file itself — such that I could move them together to a different machine and the undo history would portably be still there on the other machine.
It seemed natural to use a modeline for this, so I tried:
# vi: undodir=.:undofile
But when opening the file, I got:
Error detected while processing modelines:
line 1:
E520: Not allowed in a modeline: undodir=.
I guess this is because 'undodir'
is a global setting...
Now I'm not sure if there is a workable way to do this...