DEV Community

Discussion on: How I Got "Go To Definition" Working in Vim in 2019

Collapse
 
waylonwalker profile image
Waylon Walker • Edited

My fingers are locked on gd for go to definition and gh for hover and show docs.

Here are two ways that I have found to work for me with Python.

Go To Definition

nnoremap gd :YcmCompleter GoTo<CR>
nnoremap gd :call CocActionAsync('jumpDefinition')<CR>
Enter fullscreen mode Exit fullscreen mode

Hover

nnoremap gd :YcmCompleter GetDoc<CR>
nnoremap gd :call CocActionAsync('doHover')<CR>
Enter fullscreen mode Exit fullscreen mode
Collapse
 
mareksamec profile image
mareksamec

Awesome, thank you for this comment, this does exactly what I need!