How to Override Backup Control to Implement File Versioning?
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. Thanks, Bob -- NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. --
How to Override Backup Control to Implement File Versioning?
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. Thanks, Bob -- NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. --