Page 1 of 1

Zeus and gocode Autocomplete

Posted: Tue Jun 19, 2012 7:33 am
by jussij
Introduction
The latest Zeus release adds support for gocode autocomplete. Here is a link to a video showing the autocomplete in action.

The latest Zeus release can be found here: http://www.zeusedit.com/download.html

This release includes the macros you need to work with the gocode tool.

Macros Included in this Release
go_code.py
go_intellisense.py
go_intellisense_dot.lua
go_intellisense_brace.lua

Macro Setup
1) Use the Options, Editor Options menu.

2) In the Keyboard Mapping section edit the active keyboard and bind the go_intellisense_dot.lua to the '.' (i.e. the period) keyboard character.

3) In the Keyboard Mapping section edit the active keyboard and bind the go_intellisense_brace.lua to the '(' (i.e. the brace) keyboard character.

4) Bind the go_intellisense.py macro to some other keyboard key combination (i.e. Ctrl+Space etc).

How They Work
The go_intellisense.py macro does general autocomplete and can be used for example to autocomplete somthing like this:

Code: Select all

    fmt.Pr|
          ^cursor here and press the Ctrl+Space autocomplete keyboard keys (i.e. step 4)
The go_intellisense_dot.lua macro does auto complete whenever the '.' character is entered, for example:

Code: Select all

   math.
       ^fires on the '.' key press
The go_intellisense_brace.lua macro does auto complete whenever the '(' character is entered, for example:

Code: Select all

   math.Abs(
           ^fires on the '(' key press
Other Go Language Topics
Setting up the Go compiler
Go Auto-formatting on Save (using goimports)

Cheers Jussi