Call YouCompleteMe GoTo and vim-go GoDef depending on filetype

1 Point

Ory Band Ory Band

10 years ago

Map ] as a go-to-source function, which call file-type-specific go-to functions.

" Call YCM GoTo or vim-go GoTo depending on file type. 
function! GoToDef()
    if &ft == 'go'
        call go#def#Jump()
    else
        execute 'YcmCompleter GoTo'
    endif
endfunction
nnoremap <leader>] :call GoToDef()<CR>