In Convinced by Sublime Text I already wrote about Sublime Text 2, my preferred editor I'm using under OS X and Linux. It's already very powerful out of the box. But together with the Package Control plugin and the large number of available packages it gets even better. Searching, installing, updating, removing, everything works like a charm.
Today I want to show you the GoSublime package by DisposaBoy. It provides
- the well-known code completion of gocode by nsf,
- own snippets for code-completion which intelligent - by type-comparison - try to use variables of the surrounding context,
- simple adding and removing of imports,
- direct jumps to imports, e.g. for defining an alias,
- live error detection and highlighting using gotype; a list can be get with Cmd-. Cmd-E,
- a build system simply based on the Go tools; so not only a go build or go test are possible, also variants like go test -i or go test -test.cpu 8 -test.v,
- error cycling using F4/Shift-F4 (beside clicking on the error in the output window),
- simple jump between the errors in different files and back,
- formatting of the source with gofmt automatically when saving or by command and
- directly run/play the current file.
Most of those commands can be accessed via the Cmd-. Cmd-. shortcut. Some or directly part of the plugin and so developed in Python. But a lot is done in MarGo, also developed by DisposaBoy, but in Go. Both tools are not yet done but grow fast. Every few days the automatic update of Package Control shows new changes and the change log is very interesting. Soon there will be
- a system wide jump to the definition of a function or variable,
- a display of Go docs in the editor and
- a share of code from inside the editor in play.golang.org (it's already working in the developer releases of Sublime Text 2).
So if you're a Go developer looking for a powerful environment try this duo.