How to Enable Auto Save on Sublime Text 2

409 views
Skip to first unread message

Alex Chaffee

unread,
Jan 21, 2013, 6:22:16 PM1/21/13
to Theodore Wilson, groupiter-dev
http://blog.thekindof.me/2012/08/13/enable-auto-save-on-sublime-text-2/

Sublime Text2 -> Preferences -> Settings - Default

Then set:

"save_on_focus_lost": true,


This may prevent some of those garbled checkins when you edit and then
forget to save a file before doing a git pull.


--
Alex Chaffee - al...@stinky.com
http://alexchaffee.com
http://codelikethis.com
http://twitter.com/alexch

Theo Wilson

unread,
Jan 22, 2013, 2:49:26 PM1/22/13
to groupi...@googlegroups.com
Good find!  Though I'm more worried about files being autosaved when I switch to a branch where they didn't previously exist (or had been deleted) and having them suddenly pop up in the commit.


--



Alex Chaffee

unread,
Jan 22, 2013, 4:31:40 PM1/22/13
to groupiter-dev


On Tue, Jan 22, 2013 at 2:49 PM, Theo Wilson <th...@groupiter.com> wrote:
Good find!  Though I'm more worried about files being autosaved when I switch to a branch where they didn't previously exist (or had been deleted) and having them suddenly pop up in the commit.

I don't think that's a risk (unless you somehow switch branches from within Sublime). Every time you switch to Terminal (before doing "git checkout") your files will be saved into the old branch, and then git will take it from there.

Then the question is, if files change (or get deleted) on disk, will Sublime be smart enough to update its buffers once it gets focus again?
Reply all
Reply to author
Forward
0 new messages