Automatic Backups
Automatic backups with historical navigation for Sublime Text.
Details
Installs
- Total 12K
- Win 8K
- Mac 3K
- Linux 2K
Nov 21 | Nov 20 | Nov 19 | Nov 18 | Nov 17 | Nov 16 | Nov 15 | Nov 14 | Nov 13 | Nov 12 | Nov 11 | Nov 10 | Nov 9 | Nov 8 | Nov 7 | Nov 6 | Nov 5 | Nov 4 | Nov 3 | Nov 2 | Nov 1 | Oct 31 | Oct 30 | Oct 29 | Oct 28 | Oct 27 | Oct 26 | Oct 25 | Oct 24 | Oct 23 | Oct 22 | Oct 21 | Oct 20 | Oct 19 | Oct 18 | Oct 17 | Oct 16 | Oct 15 | Oct 14 | Oct 13 | Oct 12 | Oct 11 | Oct 10 | Oct 9 | Oct 8 | Oct 7 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 1 | 1 | 0 | 1 | 0 | 2 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 |
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.