Textmate2 save lost focus

TextMate v1 has the ability to maintain lost focus. That is, when you switch to another application, your TextMate documents will be saved. How can I recreate this behavior in TextMate 2?

+8
textmate textmate2
source share
5 answers

There is a plugin for TextMate 2 that allows you to save on focus: Save-On-Focus-Lost , just install the plugin, and you will have a function returned even in TexMate 2.

+4
source share

The way to do this has changed with alpha .9495. From README to Save-On-Focus-Lost repo:

You can now set saveOnBlur to .tm_properties so that TextMate saves files when focus is lost.
...

Using .tm_properties also makes it easy to orient certain types of files, for example, you can use:

[ ui/**.php ] saveOnBlur = true 

In this case, only .php files are automatically saved in the ui folder when focus is lost.

It is also very nice because it allows you to set it as a project-specific parameter.

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

+11
source share

Edit the file: ~ / Library / Application Support /TextMate/Global.tmProperties

and add the line:

saveOnBlur = true

The Global.tmProperties file is only loaded at startup, so you need to save all the changes, exit and restart TextMate for this to take effect.

+2
source share

Plugin: https://github.com/bomberstudios/Save-On-Focus-Lost.tmbundle works for me in mavericks, but the package path is different from the one described in the github instructions.

I think the packages are installed in: / Library / Application Support / Avian / Bundles in TextMate2

Cloning a beam there (git clone https://github.com/bomberstudios/Save-On-Focus-Lost.tmbundle.git ) works fine.

+1
source share

The saveOnBlur value only works for a file that has been saved at least once. That is, a file that exists on disk. If you check it by opening a new temporary file, typing something, and then canceling it again and again, the file will not be saved because there is no file on the disk. Save the temporary file, then check. It should work.

0
source share

All Articles