go-tmbundle

A TextMate bundle for the Go programming language.

  • 所有者: AlanQuatermain/go-tmbundle
  • 平台:
  • 许可证: Other
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

== Go
(a TextMate 2 language bundle)
Version 2.0.1

=== Installation

The easiest way to install this bundle is to let TextMate 2 do the work for you: create a new .go file and open it in TextMate. The application will then suggest the Go language format and will download and install the bundle for you.

If you'd rather do things manually, or if you want to make changes to the repository, then in a Terminal window do:

mkdir ~/Library/Application\ Support/Avian/Bundles
cd ~/Library/Application\ Support/Avian/Bundles
git clone git://github.com/AlanQuatermain/go-tmbundle.git Go.tmbundle

=== Features
The bundle here implements a language syntax, some snippets, and some compile/format/documentation commands for the Go language (http://golang.org/). Much of the current infrastructure was created by Martin Kühl (http://github.com/mkhl), who is a significantly more seasoned TextMate bundle developer than I, and to whom I am eternally grateful.

Support for Go 1.0 was provided by Jeremy Whitlock (http://github.com/whitlockjc) and Michael Sheets (http://github.com/infininight), with additional code and fixes from Sylvain Defresne (http://github.com/sdefresne), liuyork (http://github.com/liuyork), and Alexey Palazhchenko (http://github.com/AlekSi).

=== Snippets

==== Simple Statements
[Cmd-i] '+iota+'
[,] A pair ('first, second'), suitable for declaring result variables from a multi-return-value function or a map range loop.
[<] Send/receive through a channel. Provides tab stops for the value and the channel name.
[def] A default clause within a switch.
[in] An empty interface type (i.e. matches anything).
[imp] An import statement with optional alternative name.
[imps] A multiple-import statement.
[pkg] A package declaration including an optional comment block for packages other than 'main'.
[ret] A return statement with optional return value.

==== Initializers and Declarations
[:] A short-form variable initializer (i.e. 'name := value').
[[]] A slice variable type; expands to '[]+type+', so is usable inside other snippets.
[ch] A channel type.
[con] A single constant declaration.
[cons] A multiple constant declaration block.
[fun] A function type definition statement.
[int] An interface definition with a single method.
[mk] A make statement (used for creating & initializing channels, maps, etc.).
[map] A map variable type; expands to 'map[+keytype+]+valuetype+'.
[new] A new statement (used to create & initialize structure types).
[st] A struct definition with a single member.
[type] A type declaration, with name and variable type as tab-stops.
[types] A block with multiple type declarations.
[var] Declare a variable with an optional initial value (long form, i.e. 'var x int = 10').
[vars] A block of long-form variable declarations.

==== Functions
[de] A deferred goroutine call (defines the function inline).
[func] A plain (global) function declaration, with tab stops for name, parameters, and a single optional result.
[funcv] A plain (global) function declaration, with tab stops for name, parameters, and multiple results.
[go] An immediate goroutine call (defines the function inline).
[init] A template for a module's +init()+ function, with a tab stop at its body.
[main] A template for a +main()+ function with a tab stop at its body.
[meth] Declares a function on a particular type, with additional tab stops for receiver name and type and a single optional result.
[methv] Declares a function on a particular type, with additional tab stops for receiver name and type and multiple results.

==== Control Statements
[case] A case clause, within a switch or select.
[for] A for loop.
[fori] A for loop with an index (similar to C for loops).
[forr] A for loop iterating over a collection's full range.
[if] An if statement, properly formatted (Go requires the use of {} on ifs, unlike C; this throws me sometimes).
[sel] A select statement, for looping over channel conditions.
[sw] A switch statement with an optional expression.

=== Commands
[Cmd-K] Build the current package or executable.
[Cmd-R] Compile and run the current file.
[Cmd-Opt-T] Launch the unittests for the current package using "go test".
[Ctrl-Shift-H] Reformat the document according to the Go style guidelines.
[Ctrl-H] Show the Go HTML documentation for the currently-selected symbol.
[] Complete the symbol under the cursor.

=== Thanks
Thanks be to lasersox and Infininight over at the #textmate room on IRC (irc://irc.freenode.net/textmate) for all their help in cleaning up this here bundle, and for helping me to optimize my regex use in the language grammar.
Thanks to Martin Kühl for his extensive additions to this project's snippets and commands. Also Infininight's work on updating the bundle to use the TextMate's new Ruby interface and Jeremy & Sylvain's work on supporting Go 1.0 has been invaluable. Their assistance and stewardship while I've been deep in the world of Objective-C is very much appreciated.

=== Contact Information

You can contact me through github, or you can ping me on Twitter or alpha.app.net as 'alanQuatermain'.

Happy coding :)

主要指标

概览
名称与所有者AlanQuatermain/go-tmbundle
主编程语言Ruby
编程语言Ruby (语言数: 1)
平台
许可证Other
所有者活动
创建于2009-11-18 05:45:40
推送于2019-09-11 12:40:10
最后一次提交2013-07-17 07:11:13
发布数5
最新版本名称RELEASE_1_3 (发布于 )
第一版名称RELEASE_1_0_0 (发布于 )
用户参与
星数125
关注者数9
派生数40
提交数194
已启用问题?
问题数38
打开的问题数24
拉请求数20
打开的拉请求数6
关闭的拉请求数5
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?