Skip to content

Commit 72380d3

Browse files
Initial import
0 parents  commit 72380d3

14 files changed

+833
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

Go.tmbundle/Commands/Run.tmCommand

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>beforeRunningCommand</key>
6+
<string>nop</string>
7+
<key>command</key>
8+
<string>#!/usr/bin/env ruby
9+
10+
require ENV["TM_SUPPORT_PATH"] + "/lib/tm/executor"
11+
require ENV["TM_SUPPORT_PATH"] + "/lib/tm/save_current_document"
12+
13+
TextMate.save_current_document('Go')
14+
TextMate::Executor.make_project_master_current_document
15+
16+
filepath = ENV["TM_FILEPATH"]
17+
base = filepath.chomp(File.extname(filepath))
18+
19+
flags = ENV["TM_GO_FLAGS"]
20+
args = [ENV["TM_CGO"] || '6g', flags, filepath].compact # remove any odd nils in the args array
21+
22+
if args[0] == '6g'
23+
# run the compiler
24+
#`#{args.join(' ')}`
25+
TextMate::Executor.run(args)
26+
# run the linker after the compiler
27+
#`6l #{base}.6`
28+
TextMate::Executor.run(['6l', base + '.6'])
29+
# run the binary after the linker
30+
args = [File.join(File.dirname(filepath), '6.out')]
31+
else
32+
# run the compiler
33+
`#{args.join(' ')}`
34+
# run a.out after the compiler finishes
35+
args = File.join(File.dirname(filepath), 'a.out')
36+
end
37+
38+
TextMate::Executor.run(args)</string>
39+
<key>input</key>
40+
<string>document</string>
41+
<key>keyEquivalent</key>
42+
<string>@r</string>
43+
<key>name</key>
44+
<string>Run</string>
45+
<key>output</key>
46+
<string>showAsHTML</string>
47+
<key>scope</key>
48+
<string>source.go</string>
49+
<key>uuid</key>
50+
<string>0B3C3EB0-9F51-4997-A87D-ECA507D8E31E</string>
51+
</dict>
52+
</plist>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>name</key>
6+
<string>Comments</string>
7+
<key>scope</key>
8+
<string>source.go</string>
9+
<key>settings</key>
10+
<dict>
11+
<key>shellVariables</key>
12+
<array>
13+
<dict>
14+
<key>name</key>
15+
<string>TM_COMMENT_START</string>
16+
<key>value</key>
17+
<string>// </string>
18+
</dict>
19+
<dict>
20+
<key>name</key>
21+
<string>TM_COMMENT_START_2</string>
22+
<key>value</key>
23+
<string>/*</string>
24+
</dict>
25+
<dict>
26+
<key>name</key>
27+
<string>TM_COMMENT_END_2</string>
28+
<key>value</key>
29+
<string>*/</string>
30+
</dict>
31+
<dict>
32+
<key>name</key>
33+
<string>TM_COMMENT_DISABLE_INDENT_2</string>
34+
<key>value</key>
35+
<string>yes</string>
36+
</dict>
37+
</array>
38+
</dict>
39+
<key>uuid</key>
40+
<string>05400837-EE8F-44D1-A636-3EEB0E82FFF5</string>
41+
</dict>
42+
</plist>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>name</key>
6+
<string>Indentation Rules</string>
7+
<key>scope</key>
8+
<string>source.go</string>
9+
<key>settings</key>
10+
<dict>
11+
<key>decreaseIndentPattern</key>
12+
<string>(?x)
13+
^ # start of line
14+
(.*\*/)? # capture: anything followed by */ (optional)
15+
\s* \} # then whitespace and a closing curly brace
16+
( # capture:
17+
[^}{"']* \{ # anything other than curly braces or quotes, then open curly
18+
)? # (optional)
19+
[;\s]* # any whitespace or semicolons
20+
(//.*|/\*.*\*/\s*)? # capture: comments (optional)
21+
$ # end of line
22+
</string>
23+
<key>increaseIndentPattern</key>
24+
<string>(?x)
25+
^ .* \{ [^}"']* $ # lines containing an open curly but no quotes or close curly
26+
</string>
27+
<key>indentNextLinePattern</key>
28+
<string>(?x)^
29+
(?! .* [;:{}] # do not indent when line ends with ;, :, {, or }
30+
\s* (//|/[*] .* [*]/ \s* $) # …account for potential trailing comment
31+
)
32+
</string>
33+
<key>unIndentedLinePattern</key>
34+
<string>^\s*((/\*|\*/|//|import\b.*|package\b.*).*)?$</string>
35+
</dict>
36+
<key>uuid</key>
37+
<string>160118A4-208D-4422-AFF0-0C21B5B78AAF</string>
38+
</dict>
39+
</plist>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>content</key>
6+
<string>for ${2:i} := 0; $2 &lt; ${1:count}; ${3:$2++}
7+
{
8+
${0:// code}
9+
}</string>
10+
<key>name</key>
11+
<string>For Loop</string>
12+
<key>scope</key>
13+
<string>source.go</string>
14+
<key>tabTrigger</key>
15+
<string>for</string>
16+
<key>uuid</key>
17+
<string>7DA0072A-BF35-413B-B4D9-B5C2B4D20FF2</string>
18+
</dict>
19+
</plist>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>content</key>
6+
<string>if ${1:condition}
7+
{
8+
${0:// code}
9+
}</string>
10+
<key>name</key>
11+
<string>If Statement</string>
12+
<key>scope</key>
13+
<string>source.go</string>
14+
<key>tabTrigger</key>
15+
<string>if</string>
16+
<key>uuid</key>
17+
<string>AF797914-E5F7-4F2B-866B-852889C6A925</string>
18+
</dict>
19+
</plist>

Go.tmbundle/Snippets/Struct.tmSnippet

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>content</key>
6+
<string>struct
7+
{
8+
${0:var vartype};
9+
}</string>
10+
<key>name</key>
11+
<string>Struct</string>
12+
<key>scope</key>
13+
<string>source.go</string>
14+
<key>tabTrigger</key>
15+
<string>st</string>
16+
<key>uuid</key>
17+
<string>CC5D7F66-6BBC-4D9C-BC32-D569238523EB</string>
18+
</dict>
19+
</plist>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>content</key>
6+
<string>func (${1:varname typename}) ${2:func_name}($3)$4
7+
{
8+
${0:// code}
9+
}</string>
10+
<key>name</key>
11+
<string>Type Function</string>
12+
<key>scope</key>
13+
<string>source.go</string>
14+
<key>tabTrigger</key>
15+
<string>tfunc</string>
16+
<key>uuid</key>
17+
<string>D8CF6ACF-85BB-4AAD-BFDE-DFD9D075FCF2</string>
18+
</dict>
19+
</plist>

Go.tmbundle/Snippets/func.tmSnippet

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>content</key>
6+
<string>func ${1:func_name}($2)$3
7+
{
8+
${0:// code}
9+
}</string>
10+
<key>name</key>
11+
<string>Func</string>
12+
<key>scope</key>
13+
<string>source.go</string>
14+
<key>tabTrigger</key>
15+
<string>func</string>
16+
<key>uuid</key>
17+
<string>E9B44CC5-B004-4793-B125-7E429FDCCE32</string>
18+
</dict>
19+
</plist>

Go.tmbundle/Snippets/import.tmSnippet

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>content</key>
6+
<string>import ${2:altname }"${1:name}"</string>
7+
<key>name</key>
8+
<string>Import</string>
9+
<key>scope</key>
10+
<string>source.go</string>
11+
<key>tabTrigger</key>
12+
<string>imp</string>
13+
<key>uuid</key>
14+
<string>2DFA9510-6F88-4BC6-A409-DA4075DEA8FF</string>
15+
</dict>
16+
</plist>

Go.tmbundle/Snippets/main().tmSnippet

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>content</key>
6+
<string>func main()
7+
{
8+
${0:// code}
9+
}</string>
10+
<key>name</key>
11+
<string>main()</string>
12+
<key>scope</key>
13+
<string>source.go</string>
14+
<key>tabTrigger</key>
15+
<string>main</string>
16+
<key>uuid</key>
17+
<string>18A04BC9-D37A-46B9-8C92-4E8D287A46E4</string>
18+
</dict>
19+
</plist>

Go.tmbundle/Snippets/type.tmSnippet

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>content</key>
6+
<string>type ${1:name} ${2:int8}</string>
7+
<key>name</key>
8+
<string>Type</string>
9+
<key>scope</key>
10+
<string>source.go</string>
11+
<key>tabTrigger</key>
12+
<string>type</string>
13+
<key>uuid</key>
14+
<string>9E325583-D146-41A4-BA94-0B5BF91DEBF8</string>
15+
</dict>
16+
</plist>

0 commit comments

Comments
 (0)