Skip to content

Commit 9477935

Browse files
committed
README: Clarify installation and TextMate variables. Improve formatting. Add credit for msoap.
1 parent 42f5280 commit 9477935

File tree

1 file changed

+45
-32
lines changed

1 file changed

+45
-32
lines changed

README.md

Lines changed: 45 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
## golang.tmbundle
1+
# golang.tmbundle
22
(a [TextMate 2](https://github.com/textmate/textmate) bundle for the [go programming language](https://golang.org))
33

4-
### Features
4+
## Features
55

66
- Syntax highlighting
77
- Run, build, test, and install packages
@@ -11,36 +11,48 @@
1111
- Automatic imports with goimports
1212
- Linting with golint
1313
- Multiple linters supported with gometalinter
14+
- Rename go identifiers with gorename
1415
- Find symbol information with godef
1516
- 45 snippets
1617

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.
1920

2021
This bundle relies on amazing open source tooling for some functionality. These utilities can be installed with the following commands:
2122

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
47+
TM_GOCODE | /Users/myuser/go/bin/gocode
48+
TM_GOGETDOC | /Users/myuser/go/bin/gogetdoc
49+
TM_GOIMPORTS | /Users/myuser/go/bin/goimports
50+
TM_GOLINT | /Users/myuser/go/bin/golint
51+
TM_GODEF | /Users/myuser/go/bin/godef
52+
TM_GOMETALINTER | /Users/myuser/go/bin/gometalinter
53+
TM_GORENAME | /Users/myuser/go/bin/gorename
54+
55+
## Commands
4456

4557
Shortcut | Content
4658
------- | -------
@@ -57,9 +69,9 @@ Ctrl-Shift-M | Run the default linters supplied by gometalinter
5769
Ctrl-Shift-V | Run 'go vet'
5870
Opt-ESC | Complete the symbol under the cursor.
5971

60-
### Snippets
72+
## Snippets
6173

62-
#### Simple Statements
74+
### Simple Statements
6375

6476
Snippet | Content
6577
------- | -------
@@ -75,7 +87,7 @@ imps | A multiple-import statement.
7587
pkg | A package declaration including an optional comment block for packages other than 'main'.
7688
ret | A return statement with optional return value.
7789

78-
#### Initializers and Declarations
90+
### Initializers and Declarations
7991

8092
Snippet | Content
8193
------- | -------
@@ -95,7 +107,7 @@ types | A block with multiple type declarations.
95107
var | Declare a variable with an optional initial value (long form, i.e. 'var x int = 10').
96108
vars | A block of long-form variable declarations.
97109

98-
#### Functions
110+
### Functions
99111

100112
Snippet | Content
101113
------- | -------
@@ -108,7 +120,7 @@ main | A template for a +main()+ function with a tab stop at its body.
108120
meth | Declares a function on a particular type, with additional tab stops for receiver name and type and a single optional result.
109121
methv | Declares a function on a particular type, with additional tab stops for receiver name and type and multiple results.
110122

111-
#### Control Statements
123+
### Control Statements
112124

113125
Snippet | Content
114126
------- | -------
@@ -120,7 +132,7 @@ if | An if statement, properly formatted (Go requires the use of {} on ifs, un
120132
sel | A select statement, for looping over channel conditions.
121133
sw | A switch statement with an optional expression.
122134

123-
### Thanks
135+
## Thanks
124136

125137
This repository is a fork from [Jim Dovey's bundle](https://github.com/AlanQuatermain/go-tmbundle) with additional improvements merged from around the community.
126138
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):
134146
- added print, println, printf, and fprintf snippets; improved struct snippet (thanks
135147
[jish](https://github.com/jish))
136148
- HiDPI completion icons (thanks [nanoant](https://github.com/nanoant))
149+
- Bug fixes and improvements (thanks [msoap](https://github.com/msoap))
137150
- Improved, expanded documentation coverage (thanks [syscrusher](https://github.com/syscrusher))
138151
- Completion support for GOPATH and current package (thanks [syscrusher](https://github.com/syscrusher))
139152
- bugfixes (thanks everyone!)

0 commit comments

Comments
 (0)