Jumps in the Gosublime plug-in use Gsdoc, which only skips members and functions (such as FMT) that come out of the subcontract name. PRINTLN), Very inconvenient
Later found Godef This plug-in, you can achieve any object jump (instantaneous cool fly, in addition, I also added a jump back to the method)
Http://blog.buaa.us/godef-plugin-for-sublime-released/This is the release document of the GODEF author (thank you here)
The following records the installation process and the problems encountered
1. Install godef to $GOPATH/bin
Go get-v github.com/rogpeppe/godef
CD xxx/godef # target directory go
install
2. Install Guru to $GOPATH/bin
# go get-v Golang.org/x/tools/cmd/guru
# Because of the wall so use the mirror on GitHub to manually copy past
mkdir $GOPATH/src/golang.org/x-P
CD $ gopath/src/golang.org/x
git clone https://github.com/golang/tools.git
CD./tools/cmd/guru Go
Install
3. Install Godef
git clone https://github.com/buaazp/Godef.git ~/.config/sublime-text-3/packages/godef
# or in sublime Package Control Search Godef Installation
4. Configure Godef.sublime-settings
Not required by default, can be found automatically during installation, sample content:
{
"goroot": "/xxx",
"Gopath": "/xxx"
}
But because my Gopath contains $HOME directories that are not found Godef and guru (Modify Godef configuration or $GOPATH can)
This problem was found by the log printed by the Sublime console (Ctrl + ') (godef.py used Os.path.isfile () to verify that the file exists)
(or use the godef:https://github.com/chinaran/godef.git I submitted the patch in step 3rd)
5. Custom Jump shortcut keys
The default is {"Keys": ["G", "D"], "command": "Godef"} (g and D in order)
I changed it to ["Alt+q"] (see a person's preference)
For the jump back, the original author did not provide this function, so I implemented a (similar to the Ctags plug-in Jump_prev)
The default is {"Keys": ["G", "H"], "command": "Godef_prev"} (G and h in order)
I changed it to ["Alt+s"] (you can use the Godef:https://github.com/chinaran/godef.git I submitted the patch)