On 7/13/06, Robert Ingraham <[EMAIL PROTECTED]> wrote:
Hi,

I've read through the manual and checked out the FAQ, but I can't see how to
implement file versioning in Vim.

What I'd like to do is mimic the VMS file versioning feature wherein if you
edit a file (say, "file.txt") , the original is saved as "file.txt.1".
Subsequent backups of the same file are saved as "file.txt.2", "file.txt.3" and
so forth.  In this case, the most recent backup would be "file.txt.3" and second
oldest backup would be "file.txt.2" and the original file would be
"file.txt.1".
Of course, if there are no changes to the file, then no incremental backup file
is created.

I looked into writing a script to do this but, being new to Vim scripting, I
didn't see a way to hook into the internal backup logic, or if that's even the
right way to accomplish this.  I'd like it to be automatic, so the user doesn't
have to do anything different when saving a file (like having to run a script
before saving.)

Any pointers would be greatly appreciated.

Please take a look at savevers plugin:
http://www.vim.org/scripts/script.php?script_id=89

Very good plugin, I'm using it all the time on all computers where I use vim.
Many people use it, too.

It needs some config setting to begin working.
My settings are, for example

let savevers_types='*'
let savevers_max=9999
let savevers_purge=1
let savevers_dirs="~/tmp/"
"patchmode is required for savevers to work

Yakov

Reply via email to