You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+45-32Lines changed: 45 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
-
##golang.tmbundle
1
+
# golang.tmbundle
2
2
(a [TextMate 2](https://github.com/textmate/textmate) bundle for the [go programming language](https://golang.org))
3
3
4
-
###Features
4
+
## Features
5
5
6
6
- Syntax highlighting
7
7
- Run, build, test, and install packages
@@ -11,36 +11,48 @@
11
11
- Automatic imports with goimports
12
12
- Linting with golint
13
13
- Multiple linters supported with gometalinter
14
+
- Rename go identifiers with gorename
14
15
- Find symbol information with godef
15
16
- 45 snippets
16
17
17
-
###Installation
18
-
TextMate should detect .go files and load this bundle automatically.
18
+
## Installation
19
+
TextMate should detect .go files and load this bundle automatically. Syntax highlighting will work, but commands may not.
19
20
20
21
This bundle relies on amazing open source tooling for some functionality. These utilities can be installed with the following commands:
21
22
22
-
go get -u github.com/nsf/gocode # completion
23
-
go get -u github.com/zmb3/gogetdoc # documentation
24
-
go get -u golang.org/x/tools/cmd/goimports # import resolution/rewriting
25
-
go get -u github.com/golang/lint/golint # linting
26
-
go get -u github.com/rogpeppe/godef # goto definition
27
-
go get -u github.com/alecthomas/gometalinter # metalinting
28
-
go get -u golang.org/x/tools/cmd/gorename # Rename go identifiers
29
-
30
-
You may override the following TextMate variables in the preferences (adjust paths to your own configuration). TextMate does not inherit the users environment unless it is launched from the command line. It may be necessary to set TM_GOPATH and GOROOT.
31
-
32
-
TM_GO=/usr/local/bin/go
33
-
TM_GOPATH=/Users/myuser/go
34
-
TM_GOCODE=/Users/myuser/bin/gocode
35
-
TM_GOGETDOC=/Users/myuser/bin/gogetdoc
36
-
TM_GOFMT=/Users/myuser/bin/gofmt # or /Users/myuser/bin/goimports
37
-
TM_GOIMPORTS=/Users/myuser/bin/goimports
38
-
TM_GOLINT=/Users/myuser/bin/golint
39
-
TM_GODEF=/Users/myuser/bin/godef
40
-
TM_GOMETALINTER=/Users/myuser/bin/gometalinter
41
-
TM_GORENAME=/Users/myuser/bin/gorename
42
-
43
-
### Commands
23
+
Command | Use
24
+
------- | ---
25
+
go get -u github.com/nsf/gocode | Code completion
26
+
go get -u github.com/zmb3/gogetdoc | Documentation
27
+
go get -u golang.org/x/tools/cmd/goimports | Package import resolution/rewriting
28
+
go get -u github.com/golang/lint/golint | Standard linter
29
+
go get -u github.com/alecthomas/gometalinter | Combination of multiple linters
30
+
go get -u github.com/rogpeppe/godef | goto definition
31
+
go get -u golang.org/x/tools/cmd/gorename | Rename go identifiers
32
+
33
+
### TextMate Variables
34
+
TextMate does not inherit the users environment unless it is launched from the command line.
35
+
You may have to set TM_GOPATH and GOROOT inside of TextMate for all functionality to work.
36
+
You do not have to set TM_GOPATH if your GOPATH is ~/go and you are running [Go >1.8](https://golang.org/doc/go1.8#gopath).
37
+
You do not have to set GOROOT in most circumstances. See [here](https://dave.cheney.net/2013/06/14/you-dont-need-to-set-goroot-really) for more information.
38
+
39
+
You may override the following TextMate variables in the preferences, but most of these should be unnecessary (adjust paths to your own configuration):
40
+
41
+
Variable | Suggested location
42
+
-------- | ------------------
43
+
TM_GO | /usr/local/bin/go
44
+
TM_GOPATH | /Users/myuser/go
45
+
GOROOT | /usr/local/opt/go/libexec
46
+
TM_GOFMT | /Users/myuser/go/bin/gofmt OR TM_GOFMT=/Users/myuser/go/bin/goimports for automatic import resolution on file save
@@ -57,9 +69,9 @@ Ctrl-Shift-M | Run the default linters supplied by gometalinter
57
69
Ctrl-Shift-V | Run 'go vet'
58
70
Opt-ESC | Complete the symbol under the cursor.
59
71
60
-
###Snippets
72
+
## Snippets
61
73
62
-
####Simple Statements
74
+
### Simple Statements
63
75
64
76
Snippet | Content
65
77
------- | -------
@@ -75,7 +87,7 @@ imps | A multiple-import statement.
75
87
pkg | A package declaration including an optional comment block for packages other than 'main'.
76
88
ret | A return statement with optional return value.
77
89
78
-
####Initializers and Declarations
90
+
### Initializers and Declarations
79
91
80
92
Snippet | Content
81
93
------- | -------
@@ -95,7 +107,7 @@ types | A block with multiple type declarations.
95
107
var | Declare a variable with an optional initial value (long form, i.e. 'var x int = 10').
96
108
vars | A block of long-form variable declarations.
97
109
98
-
####Functions
110
+
### Functions
99
111
100
112
Snippet | Content
101
113
------- | -------
@@ -108,7 +120,7 @@ main | A template for a +main()+ function with a tab stop at its body.
108
120
meth | Declares a function on a particular type, with additional tab stops for receiver name and type and a single optional result.
109
121
methv | Declares a function on a particular type, with additional tab stops for receiver name and type and multiple results.
110
122
111
-
####Control Statements
123
+
### Control Statements
112
124
113
125
Snippet | Content
114
126
------- | -------
@@ -120,7 +132,7 @@ if | An if statement, properly formatted (Go requires the use of {} on ifs, un
120
132
sel | A select statement, for looping over channel conditions.
121
133
sw | A switch statement with an optional expression.
122
134
123
-
###Thanks
135
+
## Thanks
124
136
125
137
This repository is a fork from [Jim Dovey's bundle](https://github.com/AlanQuatermain/go-tmbundle) with additional improvements merged from around the community.
126
138
Changes from the original version (see git log for more details):
@@ -134,6 +146,7 @@ Changes from the original version (see git log for more details):
0 commit comments