6
1
I had a problem with my gVim. I lost some important modifications after I plugged on my machine after a hibernating process.
To avoid this kind of problem, I would like to know if it's possible to add something in my .vimrc (or a plugin) that automatically backups all saving made to my files. Disk space is not an issue, I can delete these files after.
I'm already using
set backup
set backupdir=~/.backup/vim
set directory=~/.swap/vim
This creates a myfile.extension~
in my .backup/vim
.
...but I would like this configuration to add ~ to first save, ~0 to second, ~1 to third, ~2 to fourth, and so on - something that keeps copies from all modifications I made to a file.
Is this possible? Do you know if there's a plugin for this?
Not this way but you could symlink the config into Dropbox which supports rollback. However, MSDOS is not a supported for Dropbox. :) – Apache – 2010-06-04T13:46:32.400
Haha, good one! It's indeed an interesting approach (Dropbox), but I can't have Dropbox installed on my work machine. :( – Somebody still uses you MS-DOS – 2010-06-04T14:23:43.850
Using NTFS's shadow copy? Or some app which monitors for changes and do the job ? (sorry for no 100% answer. :)) – Apache – 2010-06-04T17:13:19.093
I would like to have a Vim solution instead of a monitoring solution... The simpler solution I can think of is creating a script that before saving, checks files with the same names and append a number sequence to it. But since I have no experience in vim scritps, it would be difficult to me implement. – Somebody still uses you MS-DOS – 2010-06-04T19:51:14.380