ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

auto-save

by jamesfzhang ST2/ST3

Automatically saves the current file after every modification

Details

Installs

  • Total 63K
  • Win 38K
  • OS X 14K
  • Linux 11K
Dec 16 Dec 15 Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9 Dec 8 Dec 7 Dec 6 Dec 5 Dec 4 Dec 3 Dec 2 Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 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
Windows 40 56 56 60 52 57 54 57 56 58 72 61 76 32 52 54 68 62 78 50 35 44 40 64 56 52 58 40 56 49 69 49 58 70 36 50 62 69 54 67 54 45 60 56 64 52
OS X 7 16 21 23 7 19 10 14 10 11 18 15 11 13 14 15 16 13 15 13 12 8 11 18 20 10 14 5 15 16 19 18 19 16 12 11 27 20 11 20 12 18 5 28 16 17
Linux 10 12 10 16 15 18 16 7 19 13 20 19 14 6 12 18 10 20 15 11 12 11 13 9 15 16 15 13 21 13 7 14 13 22 9 10 13 15 18 17 16 11 15 18 10 18

Readme

Source
raw.​githubusercontent.​com

auto-save

A Sublime Text plugin that automatically saves the current file after every modification.

Synopsis

In the occasion where you'd want Sublime Text to save the current file after each change, you can use this plugin.

Demo

Image

Installation

From Package Control

auto-save is available through Sublime Package Control and is the recommended way to install.

From Github

Alternatively, you may install via GitHub by cloning this repository into the Packages directory under Sublime Text's data directory:

On Mac:

cd ~/Library/Application Support/Sublime Text 3/Packages
git clone https://github.com/jamesfzhang/auto-save.git

Usage

By default, auto-save is disabled because it is a fairly invasive plugin. To make it less invasive, you can instruct it to only auto-save changes to the file that is active when you turn on auto-save. In this mode, it will ignore changes to all other files.

You can also instruct it to auto-backup the file instead of auto-saving it. The backup gets created in the same directory as its source file. The backup file takes the same name as its source file, with the string .autosave inserted directly before the file extension. When auto-save is disabled, the backup file is deleted.

There are two ways to enable it. You can press Command + Shift + P to bring up the Command Palette, and search for AutoSave. Here, there are 3 options:

  • Toggle AutoSave: all files
  • Toggle AutoSave: current file only
  • Toggle AutoSave Backup: current file only

Alternatively, you can bind commands to turn the plugin on or off. For example, to toggle auto-save for all files, open “Preferences / Key Bindings - User” and add:

{ "keys": ["ctrl+shift+s"], "command": "auto_save" }

To toggle it for only the current file, and instruct to make a backup of the file instead of saving the file itself, you could add:

{ "keys": ["ctrl+shift+s"], "command": "auto_save", "args": {"all_files": false, "backup": true} }

This key bindings file takes an array of key bindings so please ensure that this key binding, along with any existing ones, are properly wrapped in [].

With this setting, pressing Ctrl + Shift + S will turn the plugin on or off. A status message will be displayed in the Sublime Status Bar each time the plugin is turned on or off.

By default, auto-save debounces “save” events by 1 second. For fast typers, this improves performance dramatically such that “save” events are not called constantly, just when it matters.

License

MIT-License.

Author

auto-save was created and maintained by James Zhang. Give him a shoutout at @jamesfzhang if you have comments or questions.