[TxMt] Creating backup files in Textmate

Marc Wilson posguy99 at gmail.com
Wed Apr 15 15:57:13 UTC 2020


BBEdit has a feature to auto-create backup files. I just tripped over this, it seems like a great thing that I'd like to figure out how to do with Textmate.

This is from BBedit 9's release notes:

The options and behavior for backing up files at save have changed, as follows:

 * "Make backup before saving" is now a global preference only, and is no longer controlled per file. The "Make Backup when Saving" and "Make Backup Now" options have been removed from the File menu.

 * The settings controlling backup location (in the Text Files prefs) have been removed. Backups are always made to a specific location, as follows:

   * If "Keep historical backups" is turned on, backups are kept in `~/Documents/BBEdit Backups/`. Within that folder is one folder for each day's backups. The format of the dated folder name is static and non-localized: `YYYY-MM-DD`. Inside of each day's backup folder will be all of the backups made on that day, each named using the 8.7.x timestamp format.

If you want the backups to live somewhere else, lay down a folder alias named "BBEdit Backups" in `~/Documents/` and BBEdit will follow the alias.

   * If "Keep historical backups" is turned *off*, BBEdit makes only a single backup, located in the same directory as the original, so "backup creep" is a thing of the past. The backup is named according to current OS conventions (which themselves follow the old Emacs convention): the backup file is named as the original file, with a tilde appended: "`foo.html~`" is the backup of "`foo.html`".

If you want the backup to have the same file name extension as the original, turn on the "Preserve file name extension" in the Text Files prefs. This will cause BBEdit to place the tilde after the "base" name of the file: "`foo~.html`".

Is there already support for anything similar to this somewhere? A bundle maybe? It'd be a save-hook, obviously.

Thanks!

--
Marc Wilson
posguy99 at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macromates.com/textmate/attachments/20200415/e1c7b364/attachment-0001.html>


More information about the TextMate mailing list