From a4a87df17d3450bd65910fa66f71420537ea2dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Fri, 23 Oct 2020 13:46:47 +0200 Subject: [PATCH] Various changes related to language support --- bundles-init/YouCompleteMe.load.vim | 1 - bundles-init/vim-lsp.cfg.vim | 26 +++++++++++++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) delete mode 100644 bundles-init/YouCompleteMe.load.vim diff --git a/bundles-init/YouCompleteMe.load.vim b/bundles-init/YouCompleteMe.load.vim deleted file mode 100644 index 47922d0..0000000 --- a/bundles-init/YouCompleteMe.load.vim +++ /dev/null @@ -1 +0,0 @@ -"NeoBundle "Valloric/YouCompleteMe" diff --git a/bundles-init/vim-lsp.cfg.vim b/bundles-init/vim-lsp.cfg.vim index 0de0404..1945d1f 100644 --- a/bundles-init/vim-lsp.cfg.vim +++ b/bundles-init/vim-lsp.cfg.vim @@ -33,9 +33,25 @@ endif " Python (requires pip install python-language-server) if executable('pyls') - au User lsp_setup call lsp#register_server({ - \ 'name': 'pyls', - \ 'cmd': {server_info->['pyls']}, - \ 'whitelist': ['python'], - \ }) + au User lsp_setup call lsp#register_server({ + \ 'name': 'pyls', + \ 'cmd': {server_info->['pyls']}, + \ 'whitelist': ['python'], + \ }) +endif + +" C/C++ through Clangd +if executable('clangd') + augroup lsp_clangd + autocmd! + autocmd User lsp_setup call lsp#register_server({ + \ 'name': 'clangd', + \ 'cmd': {server_info->['clangd']}, + \ 'whitelist': ['c', 'cpp', 'objc', 'objcpp'], + \ }) + autocmd FileType c setlocal omnifunc=lsp#complete + autocmd FileType cpp setlocal omnifunc=lsp#complete + autocmd FileType objc setlocal omnifunc=lsp#complete + autocmd FileType objcpp setlocal omnifunc=lsp#complete + augroup end endif