VIM

Vim helps protect you from unintentionally losing data by letting you make a backup of the files you edit. For an edit session that has gone terribly wrong, this can be useful because you can recover your previous file. Backups are controlled by the settings of two options: backup and writebackup. Where and how backups are created are controlled by four other options: backupskip, backupcopy, backupdir, and backupext. If both the backup and writebackup options are off (i.e., nobackup and nowritebackup), Vim makes no backup files for your edit sessions. If backup is on, Vim deletes any old backups and creates a backup for the current file. If backup is off and writebackup is on, Vim creates a backup file for the duration of the edit session and deletes the backup afterward.

The backupdir is a comma-separated list of directories in which Vim creates backup files. For example, if you want backups to always be created in your system’s temporary directory, set backupdir to "C:\TEMP" for Windows or "/tmp" for Unix and Linux.