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

auto-save

by jamesfzhang ST2/ST3 Trending

Automatically saves the current file after every modification

Details

Installs

  • Total 97K
  • Win 62K
  • OS X 19K
  • Linux 16K
Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6 Mar 5
Windows 31 61 73 63 48 42 51 50 60 53 69 73 53 52 58 63 56 65 44 54 52 59 53 65 60 47 56 51 53 54 56 72 73 51 48 60 73 53 65 62 34 61 43 61 55 53
OS X 8 12 14 11 9 9 9 12 6 8 14 12 5 5 8 25 9 10 15 7 8 8 10 7 15 14 6 3 8 10 10 12 9 7 8 23 15 12 11 6 8 9 11 11 10 8
Linux 5 13 11 8 15 6 5 9 8 22 12 6 9 10 10 6 15 11 10 15 9 14 12 12 14 15 11 13 9 12 14 10 11 13 8 8 10 13 14 9 13 9 5 12 11 8

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

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.