Automatic Backups
Automatic backups with historical navigation for Sublime Text.
Details
Installs
- Total 12K
- Win 8K
- Mac 3K
- Linux 2K
Oct 6 | Oct 5 | Oct 4 | Oct 3 | Oct 2 | Oct 1 | Sep 30 | Sep 29 | Sep 28 | Sep 27 | Sep 26 | Sep 25 | Sep 24 | Sep 23 | Sep 22 | Sep 21 | Sep 20 | Sep 19 | Sep 18 | Sep 17 | Sep 16 | Sep 15 | Sep 14 | Sep 13 | Sep 12 | Sep 11 | Sep 10 | Sep 9 | Sep 8 | Sep 7 | Sep 6 | Sep 5 | Sep 4 | Sep 3 | Sep 2 | Sep 1 | Aug 31 | Aug 30 | Aug 29 | Aug 28 | Aug 27 | Aug 26 | Aug 25 | Aug 24 | Aug 23 | Aug 22 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 2 | 0 | 1 | 0 | 1 | 1 |
Mac | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
Automatic Backups for Sublime Text
A Sublime Text 2/3 plugin to automatically save off a backup of your files each time you save.
When you edit text files (scripts, prose, whatever) you often find yourself wishing for an older version. Ever accidentally deleted a chunk from an important configuration file, or wished you could roll back a document a few hours? This plugin takes a copy of every file you save and copies it into a backup directory structure, ensuring that you never lose an old version of a file.
Installation
- Install Package Manager.
- Use
Cmd+Shift+P
orCtrl+Shift+P
thenPackage Control: Install Package
. - Look for
Automatic Backups
and install it.
If you prefer to install manually on Sublime Text 3, install git, then:
git clone https://github.com/joelpt/sublimetext-automatic-backups "<Sublime Text Packages folder>/Automatic Backups"
If you're still using Sublime Text 2, a manual install will require switching to the last ST2-compatible commit:
cd "<Sublime Text 2 Packages folder>"
git clone https://github.com/joelpt/sublimetext-automatic-backups "Automatic Backups"
cd "Automatic Backups"
git checkout st2-1.0.0
Basic usage
Once installed, any file you save will be automatically copied into your backups folder (defaults to My Documents\Sublime Text Backups
on Windows and ~/.sublime/backups
on Linux/OSX).
For example, if you change C:\autoexec.bat
on Windows, you'll get a backup saved somewhere like:
C:\Users\yourUserName\My Documents\Sublime Text Backups\C\autoexec-2012-03-22-22-22-46.bat
That end bit is the timestamp, so you can see when the file was edited.
To change where the backups are stored, access the plugin's settings in Preferences->Package Settings->Automatic Backups
.
To see if it's working, open the console with the View->Show Console
menu item. When you save a file, you should see a line like this, indicating that the file has been backed up:
Backup saved to: /home/stanislav/.sublime/backups/etc/hosts-2012-03-22-22-22-46
Backup history navigation
Automatic Backups supports easy navigation through the backup history for any file with stored backups. To use this feature:
- Press
Ctrl+Alt+[
to navigate backwards one step through a file's backup history. - Press
Ctrl+Alt+]
to navigate forwards one step. - Press
Ctrl+Shift+Alt+[
to jump to the first copy in the history. - Press
Ctrl+Shift+Alt+]
to jump to the current version (that is, the actual file, not a backup).
These commands can also be accessed via Ctrl+Shift+P
or Cmd+Shift+P
.
Merge from backup history
When viewing a backup file via backup history navigation, press Ctrl+Alt+Shift+M
to merge the backup version you're currently viewing with the latest version of the file using an external merge tool of your choosing.
You'll need to specify the command line for this merge tool; for more information go to Preferences->Package Settings->Automatic Backups->Settings - Default
.
This command can also be accessed via Ctrl+Shift+P
or Cmd+Shift+P
.
Backup size considerations
Though this plugin currently has no facility for pruning old backups, this probably won't be a problem for you. I have been running some form of this plugin for 6 years, and have a total of 85000 individual backup files stored totalling 1.25 GB uncompressed. And I can go back to the very first version of any file I've edited in Sublime Text.
To prevent your backup folder from growing too large, check out the max_backup_file_size_bytes
setting in Preferences->Package Settings->Automatic Backups
.
Credits
This code is available on Github. Pull requests are welcome.
Created by Joel Thornton.
Originally authored for Sublime Text 1 by Steve Cooper.