[TxMt] save, activate, and deactivate commands

Gerd Knops gerti-textmate at bitart.com
Sat Jul 29 19:08:58 UTC 2006


On Jul 29, 2006, at 12:37 PM, Matthew Johnson wrote:

> Currently we have tab triggers, key commands, and drag commands as  
> ways of activating commands in TextMate.  It would be very useful  
> to be able to trigger commands when a file is saved, activated, or  
> deactivated in the ui as well (there may be others but these are  
> the ones that came to my mind).  One example of where this would be  
> useful is saving a GTD project file and having it automatically  
> update a conext file with any necessary changes.
>
> What do others think of this?  Allan, how difficult would something  
> like this be?

Actually Save is easy to do and I have been using it for a lot of  
things like

- Check Perl syntax on save
- Automatically harvest/fill in markdown links on save
- etc

To set it up:

- Define an empty Command, call it 'Save', set it to Save the current  
file, and give it the Cmd-S shortcut (this is the fallback)
- For languages where you want Save to do more do as above, but add  
whatever command you desire and set the Scope Selector to the desired  
language

Works like a charme...

Gerd





More information about the textmate mailing list