Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Textmate2 save on lost focus

In TextMate v1, there was an option to save on lost focus. That is, when you'd switch to another application, your TextMate documents would save. How can I recreate this behavior in TextMate 2?

like image 238
Rose Perrone Avatar asked Jul 23 '12 01:07

Rose Perrone


1 Answers

The way to do this has changed as of alpha.9495. From the README at the Save-On-Focus-Lost repo:

You can now set saveOnBlur in .tm_properties to make TextMate save files when focus is lost.
...

Using .tm_properties also allows to easily target specific file types, for example one could use:

[ ui/**.php ]
saveOnBlur = true

This would then only have .php files in the ui folder auto-save when focus is lost.

This is also really nice because it makes it possible to set this as a project-specific setting.

But if you want to set it as a global setting, edit the file ~/Library/Application Support/TextMate/Global.tmProperties and add the line saveOnBlur = True near the beginning, before any lines with filetype-specific settings.

like image 97
kmacinnis Avatar answered Oct 07 '22 15:10

kmacinnis