[TxMt] Setting default language for new documents

Allan Odgaard throw-away-1 at macromates.com
Wed Feb 8 03:30:27 UTC 2006


On 8/2/2006, at 3:47, El Cuco wrote:

> Is there a way to set the default language for new documents to
> something other than "plain text"?

Yes, but it's a little tricky.

First you need to find the UUID of the language you want as default.

All the default languages are stored in TextMate.app/Contents/ 
SharedSupport/Bundles in the Syntaxes folder of the bundle.

This is in the binary plist format, so you'll need to convert it  
first to readable form. Let's say we want HTML to be the new default  
language, we would do (from terminal):

% cd /Applications/TextMate.app/Contents/SharedSupport/Bundles/ 
HTML.tmbundle/Syntaxes
% plutil -convert xml1 HTML.plist
% grep -A1 uuid HTML.plist
         <key>uuid</key>
         <string>17994EC8-6B1D-11D9-AC3A-000D93589AF6</string>

Here “17994EC8-6B1D-11D9-AC3A-000D93589AF6” is the UUID. Now we need  
to tell TM to use that as default by altering its defaults database.  
First quit TextMate, then from terminal run:

% defaults write com.macromates.textmate OakDefaultLanguage  
17994EC8-6B1D-11D9-AC3A-000D93589AF6

Start TextMate, and notice how all new documents are set to be HTML  
by default.




More information about the textmate mailing list