Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

BBEdit Language Module for CoffeeScript

View gist:1004413
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
BBEdit Language Module for CoffeeScript
Put this file in
~/Library/Application Support/BBEdit/Language Modules
or equivalent.
Based off of the examples shipped in the BBEdit SDK.
-->
<plist version="1.0">
<dict>
<key>BBEditDocumentType</key>
<string>CodelessLanguageModule</string>
<key>BBLMLanguageDisplayName</key>
<string>CoffeeScript</string>
<key>BBLMLanguageCode</key>
<string>CoSc</string>
<key>BBLMColorsSyntax</key>
<true/>
<key>BBLMScansFunctions</key>
<true/>
<key>BBLMIsCaseSensitive</key>
<true/>
<key>BBLMKeywordList</key>
<array>
<string>if</string>
<string>for</string>
<string>in</string>
<string>then</string>
<string>else</string>
<string>or</string>
<string>of</string>
<string>while</string>
<string>until</string>
<string>do</string>
<string>try</string>
<string>catch</string>
<string>is</string>
<string>isnt</string>
<string>unless</string>
<string>and</string>
<string>not</string>
<string>class</string>
<string>extends</string>
<string>super</string>
<string>new</string>
<string>this</string>
<string>switch</string>
<string>when</string>
<string>finally</string>
</array>
<key>BBLMSuffixMap</key>
<array>
<dict>
<key>BBLMLanguageSuffix</key>
<string>.cs</string>
</dict>
<dict>
<key>BBLMLanguageSuffix</key>
<string>.coffee</string>
</dict>
</array>
<key>Language Features</key>
<dict>
<key>Identifier and Keyword Character Class</key>
<string>0-9A-Z_a-z</string>
 
<key>Comment Pattern</key>
<string>(?x:
(?&gt; \( ) |
(?&gt; \) ) |
(?&gt; \[ ) |
(?&gt; \] ) |
(?&gt; \{ ) |
(?&gt; \} ) |
(?&gt; \: ) |
(?&gt; \@ ) |
(?&gt; -&gt; ) |
(?&gt; \# .* $ ) |
(?&gt; \#\#\# (?s:.*?) (?: \#\#\# | \z ))
)</string>
 
<key>String Pattern</key>
<string>(?x:
(?&gt; ` (?s: \\. | [^`] )*? (?: ` ) ) |
(?&gt; /// (?s: \\. | [^/] )*? (?: /// ) ) |
(?&gt; """ (?s: \\. | [^"] )*? (?: """ ) ) |
(?&gt; ''' (?s: \\. | [^'] )*? (?: ''' ) ) |
(?&gt; " (?s: \\. | [^"] )*? (?: " ) ) |
(?&gt; ' (?s: \\. | [^'] )*? (?: ' ) )
)</string>
</dict>
</dict>
</plist>
Zearin commented

Thanks! This is great :)

For BBEdit 10 (via mac app store) I had to create the Language Modules folder. Also make sure the file is saved with a plist extension or BBEdit won't pick up on it.

Owner

Talked to Josh off-line, re BB10.

The directory to put this in is still

~/Library/Application Support/BBEdit/Language Modules

but you may need to create the directory(s) if they don't already exist.

Suggest folks name this file CoffeeScript.plist.

evandavis's fork (gist: 3219871) has some nice improvements, such as support for multi-line comments.

(disclaimer: I didn't look at all of the forks)

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.