diff options
author | Julian T <julian@jtle.dk> | 2020-12-15 21:04:44 +0100 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2020-12-15 21:04:44 +0100 |
commit | aa9f80fca454f99f5fa24b90ffd745ca60040552 (patch) | |
tree | 055718947c0603eae0570f19268e2b9a1cf78d9f /vim-extra/.vim | |
parent | 4af935c9576e237b6e8f87e6a28999d8d94d012e (diff) |
Vim auto complete and stuff
Diffstat (limited to 'vim-extra/.vim')
-rw-r--r-- | vim-extra/.vim/extra.vim | 82 |
1 files changed, 19 insertions, 63 deletions
diff --git a/vim-extra/.vim/extra.vim b/vim-extra/.vim/extra.vim index 809527f..716fed2 100644 --- a/vim-extra/.vim/extra.vim +++ b/vim-extra/.vim/extra.vim @@ -9,8 +9,10 @@ Plugin 'VundleVim/Vundle.vim' " Completion - Plugin 'prabirshrestha/vim-lsp' + "Plugin 'Shougo/deoplete.nvim' Plugin 'ajh17/VimCompletesMe' + " Plugin 'prabirshrestha/vim-lsp' + Plugin 'autozimu/LanguageClient-neovim' Plugin 'Shougo/echodoc.vim' " Installed through vim-core @@ -59,70 +61,24 @@ let g:echodoc#type = 'virtual' endif - " Lsp options - let g:lsp_signature_help_enabled = 0 - let g:lsp_insert_text_enabled = 0 - let g:lsp_virtual_text_enabled = 0 - let g:lsp_diagnostics_echo_cursor = 1 - let g:lsp_highlights_enabled = 0 - let g:lsp_textprop_enabled = 0 - let g:lsp_signs_enabled = 1 + "let g:deoplete#enable_at_startup = 1 + "let g:deoplete#disable_auto_complete = 1 + + let b:vcm_tab_complete = 'omni' " Close completion window autocmd CompleteDone * pclose - " Setup lsp servers - if executable('clangd') - au User lsp_setup call lsp#register_server({ - \ 'name': 'clangd', - \ 'cmd': {server_info->['clangd']}, - \ 'whitelist': ['c', 'cpp'], - \ }) - endif - if executable('pyls') - au User lsp_setup call lsp#register_server({ - \ 'name': 'pyls', - \ 'cmd': {server_info->['pyls']}, - \ 'whitelist': ['py', 'python'], - \ }) - endif - if executable('gopls') - au User lsp_setup call lsp#register_server({ - \ 'name': 'golang', - \ 'cmd': {server_info->['gopls']}, - \ 'whitelist': ['go'], - \ }) - endif - if executable('rls') - au User lsp_setup call lsp#register_server({ - \ 'name': 'rust', - \ 'cmd': {server_info->['rls']}, - \ 'whitelist': ['rust', 'rs'], - \ }) - endif - if executable('solargraph') - au User lsp_setup call lsp#register_server({ - \ 'name': 'ruby', - \ 'cmd': {server_info->['solargraph', 'stdio']}, - \ 'whitelist': ['ruby', 'rb'], - \ }) - endif - - " Enable csp if available, stolen from lsp github - function! s:on_lsp_buffer_enabled() abort - echo "Enabling lsp" - set omnifunc=lsp#complete - let b:vcm_tab_complete = 'omni' - set signcolumn=yes - nmap <buffer> gd <plug>(lsp-definition) - nmap <buffer> <f2> <plug>(lsp-rename) - nmap <buffer> zF <plug>(lsp-code-action) - " refer to doc to add more commands - 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 + " Lsp options + " let g:LanguageClient_setOmnifunc = 1 + let g:LanguageClient_hoverPreview = "Never" + let g:LanguageClient_useVirtualText = "No" + " Setup lsp servers + let g:LanguageClient_serverCommands = { + \ 'c' : ['clangd'], + \ 'cpp' : ['clangd'], + \ 'python' : ['pyls'], + \ 'go' : ['gopls'], + \ 'rust' : ['rls'], + \ } |