Use :GoDef for navigation among functions.
When hits gd or ctrl-] or just :GoDef, it will jump to the declaration immediately, as with GoLand's "Go To Declaration" (the shortcut is CMD-B in macOS High Sierra).
:GoDef takes too much time for Searching declaration ..., compared to GoLand. Seems like some Cache or Search Directory issues. Maybe the solution is just define some root searching path.
vim-go version:
latest
vimrc you used to reproduce (use a minimal vimrc with other plugins disabled; do not link to a 2,000 line vimrc):
Latest version of https://github.com/amix/vimrc , which is popular, and embeds vim-go. A minimal vimrc is still used when testing though.
Vim version (first three lines from :version):
8.0.1283
Go version (go version):
go version go1.10.1 darwin/amd64
go env):GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/pyericz/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/pyericz/Workspace/Golang"
GORACE=""
GOROOT="/usr/local/opt/go/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/opt/go/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/70/nnmrjvv50q7gmn4d3fndb13c0000gn/T/go-build623267033=/tmp/go-build -gno-record-gcc-switches -fno-common"
I think it's guru problem. By default, :GoDef uses guru, which is very slow. When change go_def_mode to godef with following configuration, it becomes nice and smooth.
let g:go_def_mode = 'godef'
Most helpful comment
I think it's
guruproblem. By default,:GoDefusesguru, which is very slow. When changego_def_modetogodefwith following configuration, it becomes nice and smooth.