I'd like vim to keep the backup of a file until that file is closed, instead of overwriting the backup every time the file is saved. How can I do that?
NB: the backup should become a copy of the file as the file was when I last saved it before closing. That is, if I edit a file and quit without saving, the backup should not be written.