From: Sergey Matveev Date: Fri, 10 Jul 2020 15:43:27 +0000 (+0300) Subject: Working with LSP X-Git-Url: http://www.git.stargrave.org/?p=dotfiles.git;a=commitdiff_plain;h=5c68aeb2bf368d8dafa1be0af423830580010b25 Working with LSP --- diff --git a/vim/.vim/plugin/lsp.vim b/vim/.vim/plugin/lsp.vim new file mode 100644 index 0000000..1348fc4 --- /dev/null +++ b/vim/.vim/plugin/lsp.vim @@ -0,0 +1,22 @@ +let g:lsp_settings = { +\ 'clangd': {'cmd': ['clangd60']}, +\} + +let g:asyncomplete_auto_completeopt = 0 +let g:lsp_settings_enable_suggestions = 0 +let g:lsp_highlight_references_enabled = 1 +let g:lsp_diagnostics_echo_cursor = 1 + +function! s:on_lsp_buffer_enabled() abort + setlocal completeopt=menuone,noinsert,noselect + setlocal omnifunc=lsp#complete + nmap [g (lsp-previous-diagnostic) + nmap ]g (lsp-next-diagnostic) + nmap gd (lsp-definition) + nmap K (lsp-hover) +endfunction + +augroup lsp_install + autocmd! + autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled() +augroup END