Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'gd' doesn't work #1149

Closed
jianzhangbjz opened this issue Dec 23, 2016 · 6 comments
Closed

'gd' doesn't work #1149

jianzhangbjz opened this issue Dec 23, 2016 · 6 comments

Comments

@jianzhangbjz
Copy link

Hey Guys,

The gd command doesn't work, but the GoDef works. The godef binary locate in /bin/godef, and the below is my vimrc, something else I missed?

set omnifunc=syntaxcomplete#Complete
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_fields = 1
let g:go_highlight_types = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
" let g:go_fmt_command = "goimports"
let g:go_fmt_autosave = 1
let g:go_get_update = 0
let g:godef_split = 1
" vim-go custom mappings
au FileType go nmap <Leader>gd <Plug>(go-doc)
@irightcode
Copy link

I am newbie also, I don't think you need a mapping for 'gd'. It overwrite the default 'gd' in normal mode.

Go to function/identifier in normal mode and press 'g' then 'd'. It should go to the definition.

@irightcode
Copy link

I apologize, I didn't read your question properly. Are you getting an error with gd?

@jianzhangbjz
Copy link
Author

@irightcode No, I didn't get any output after press gd, seems the gd command doesn't work.

@bhcleek
Copy link
Collaborator

bhcleek commented Dec 28, 2016

I use gd regularly, and haven't had any problems. Is it possible that you're trying to use it in a modified buffer? #1132 fixed an issue when using :GoDef (and consequently, gd) in a modified buffer...

@fatih
Copy link
Owner

fatih commented Dec 28, 2016

Hi @jianzhangbjz

You have probably a plugin that overrides gd or go_def_mapping_enabled is set to 0. Please check both cases. I suggest to remove all plugins and only use vim-go and then gradually add plugins until you find the plugin that causes the problem. Thanks

@fatih fatih closed this as completed Dec 28, 2016
@jianzhangbjz
Copy link
Author

@bhcleek I have update it to the latest version, but the problem still exists.
@fatih I have removed other plugins, but gd still does not work, the below is my config. can you help point out my errors?

set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'

Plugin 'fatih/vim-go'

" Plugin 'Valloric/YouCompleteMe'

" Plugin 'ftplugin/go.vim'

" Plugin 'ervandew/supertab'

" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
set omnifunc=syntaxcomplete#Complete
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_fields = 1
let g:go_highlight_types = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
" let g:go_fmt_command = "goimports"
let g:go_fmt_autosave = 1
let g:go_get_update = 0
let g:godef_split = 1
let g:go_def_mapping_enabled = 1
au FileType go nmap <Leader>gd <Plug>(go-doc)
au FileType go nmap <Leader>gv <Plug>(go-doc-vertical)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants