Saturday, December 13, 2014

Set Default File Type to Shell Script (Bash) in TextMate


Run this:

defaults write com.macromates.textmate OakDefaultLanguage DDEEA3ED-6B1C-11D9-8B10-000D93589AF6


All the default languages are stored in 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/ Script.tmbundle/Syntaxes 
$ plutil -convert xml1 Shell-Unix-Generic.plist
$ grep -A1 uuid Shell-Unix-Generic.plist

Here “DDEEA3ED-6B1C-11D9-8B10-000D93589AF6” is the UUID for Bash Shell Script. 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 DDEEA3ED-6B1C-11D9-8B10-000D93589AF6

Start TextMate, and notice how all new documents are set to be Shell Script (Bash) by default.


This works for TextMate 1.5

Here's the list of supported file types:
  • ActionScript.tmbundle
  • Apache.tmbundle
  • AppleScript.tmbundle
  • Blogging.tmbundle
  • Bundle Development.tmbundle
  • C.tmbundle
  • CoffeeScriptBundle.tmbundle
  • CSS.tmbundle
  • Diff.tmbundle
  • Git.tmbundle
  • HTML.tmbundle
  • Hyperlink Helper.tmbundle
  • Java.tmbundle
  • JavaDoc.tmbundle
  • JavaScript.tmbundle
  • LaTeX.tmbundle
  • Mail.tmbundle
  • Make.tmbundle
  • Markdown.tmbundle
  • Math.tmbundle
  • Objective-C.tmbundle
  • OpenGL.tmbundle
  • Perl.tmbundle
  • PHP.tmbundle
  • Property List.tmbundle
  • Python.tmbundle
  • Ruby on Rails.tmbundle
  • Ruby.tmbundle
  • Shell Script.tmbundle
  • Source.tmbundle
  • SQL.tmbundle
  • Subversion.tmbundle
  • Text.tmbundle
  • Textile.tmbundle
  • TextMate.tmbundle
  • TODO.tmbundle
  • Transmit.tmbundle
  • Xcode.tmbundle
  • XML.tmbundle
  • YAML.tmbundle


Share this article

This work is licensed under the Creative Commons Attribution 3.0 Unported License.

No comments:

Post a Comment