Plug 'prabirshrestha/vim-lsp' Plug 'prabirshrestha/asyncomplete.vim' Plug 'prabirshrestha/asyncomplete-lsp.vim' au User lsp_setup call lsp#register_server({ \ 'name': 'CiderLSP', \ 'cmd': {server_info->[ \ '/google/bin/releases/cider/ciderlsp/ciderlsp', \ '--tooltag=vim-lsp', \ '--noforward_sync_responses', \ '-hub_addr=blade:languageservices-staging' \ ]}, \ 'allowlist': ['c', 'cpp', 'java', 'kotlin', 'proto', 'textproto', 'go', 'python', 'bzl', 'sql', 'yaml', 'googlesql', 'build', 'typescript', 'gcl', 'soy'], \}) " Send async completion requests. " WARNING: Might interfere with other completion plugins. let g:lsp_async_completion = 1 " Enable UI for diagnostics let g:lsp_signs_enabled = 1 " enable diagnostics signs in the gutter let g:lsp_diagnostics_echo_cursor = 1 " enable echo under cursor when in normal mode let g:lsp_diagnostics_float_cursor = 1 " enable floating window diagnostics " Automatically show completion options let g:asyncomplete_auto_popup = 1 function! s:on_lsp_buffer_enabled() abort setlocal omnifunc=lsp#complete setlocal signcolumn=yes if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif nmap gd (lsp-definition) nmap gs (lsp-document-symbol-search) nmap gS (lsp-workspace-symbol-search) nmap gr (lsp-references) nmap gi (lsp-implementation) nmap gt (lsp-type-definition) nmap ga (lsp-code-action) nmap rn (lsp-rename) nmap [g (lsp-previous-diagnostic) nmap ]g (lsp-next-diagnostic) inoremap lsp#scroll(+4) inoremap lsp#scroll(-4) nmap L (lsp-hover) endfunction augroup lsp_install au! " call s:on_lsp_buffer_enabled only for languages that has the server registered. autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled() augroup END