GO Syntax Coloring for BBEdit and TextWrangler

1,115 views
Skip to first unread message

ajstarks

unread,
Nov 11, 2009, 10:54:23 PM11/11/09
to golang-nuts
Here is the Codeless language Module used by BBEdit and TextWrangler
that will provide syntax coloring and function navigation. Go
language experts will surely extend from the basics supported here.

Install as Go.plist in:

~/Library/Application Support/TextWrangler/Language Modules

or

~/Library/Application Support/BBEdit/Language Modules

----- cut here ----

{
BBEditDocumentType = "CodelessLanguageModule";
BBLMColorsSyntax = YES;
BBLMIsCaseSensitive = YES;
BBLMKeywordList = (
break,
case,
chan,
const,
continue,
default,
defer,
else,
fallthrough,
for,
func,
go,
goto,
if,
import,
interface,
map,
package,
range,
return,
select,
struct,
switch,
type,
var,
);
BBLMLanguageCode = go;
"BBLMLanguageDisplayName" = "Go";
BBLMScansFunctions = YES;
BBLMSuffixMap = (
{
BBLMLanguageSuffix = ".go";
},
);
"Language Features" = {
"Close Block Comments" = "*/";
"Close Parameter Lists" = ")";
"Close Statement Blocks" = "}";
"Close Strings 1" = "`";
"Close Strings 2" = "\"";
"End-of-line Ends Strings 1" = YES;
"End-of-line Ends Strings 2" = YES;
"Escape Char in Strings 1" = "\\";
"Escape Char in Strings 2" = "\\";
"Identifier and Keyword Characters" =
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";
"Open Block Comments" = "/*";
"Open Line Comments" = "//";
"Open Parameter Lists" = "(";
"Open Statement Blocks" = "{";
"Open Strings 1" = "`";
"Open Strings 2" = "\"";
"Prefix for Functions" = "func";
"Prefix for Procedures" = func;
"Terminator for Prototypes 1" = ";";
"Terminator for Prototypes 2" = "";
};
}

Quenio

unread,
Nov 14, 2009, 12:14:50 AM11/14/09
to golang-nuts
Very nice! Thank you so much for sharing.

I am attaching attached a version of the file to the group. It should
be just drag-and-drop...

Quenio

unread,
Nov 14, 2009, 12:19:43 AM11/14/09
to golang-nuts
Here is a link to the file Go module:
http://dl.dropbox.com/u/2242899/TextWranglerGoModule.zip

matthe...@percona.com

unread,
Nov 8, 2017, 1:02:58 PM11/8/17
to golang-nuts
This does not recognize struct methods. Can you improve it?

Example: func (p *MyClass) DoSomething(p string, i int) { ... }
Reply all
Reply to author
Forward
0 new messages