vim plugin providing godef support
Vim script
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
plugin Update godef.vim Jul 20, 2016 point to vim-go Jan 18, 2018

You probably want to be using instead

This plugin adds godef support to vim.

The godef tool from Roger Peppe parses Go code and returns the location of the definition of a symbol. It can be installed with

go get -v
go install -v

To install the vim-godef plugin, clone this vim-godef repository and (from it) copy plugin/godef.vim to ~/.vim/plugin .

Or, if you're using pathogen, on Linux:

git clone ~/.vim/bundle/vim-godef

or on Windows:

git clone %USERPROFILE%\vimfiles\bundle\vim-godef

This modules overrides the gd (go to local definition) command to open a new window at the definition of the symbol under the cursor. Setting


(that is, entering the command let g:godef_split=0 or inserting it into your ~/.vimrc) will reuse the current window, and


will open the definition in a new tab, and


will use a vertical split instead of the default horizontal split.

If you want jumps to the same file to move your current cursor instead of splitting, use


This also adds a :Godef which will work for global types, methods, constants, and variables in the current package.