aboutsummaryrefslogtreecommitdiff
path: root/.vim/after/plugin/lsp.vim
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2022-04-09 14:03:41 +0800
committerGuangxiong Lin <[email protected]>2022-04-09 14:03:41 +0800
commit144b3386e9efbcc52c4233e59f5995b0f0be0fc1 (patch)
tree1212b1ac0e2e79b3341eb12794d0f4557cc9b5b0 /.vim/after/plugin/lsp.vim
parent7f46db0ec4dfc6549faf9e9c957527a5433f81a8 (diff)
downloaddotfiles-144b3386e9efbcc52c4233e59f5995b0f0be0fc1.tar.gz
dotfiles-144b3386e9efbcc52c4233e59f5995b0f0be0fc1.tar.bz2
dotfiles-144b3386e9efbcc52c4233e59f5995b0f0be0fc1.zip
Use clangd to help complete c-family language (vim)
Diffstat (limited to '.vim/after/plugin/lsp.vim')
-rw-r--r--.vim/after/plugin/lsp.vim8
1 files changed, 8 insertions, 0 deletions
diff --git a/.vim/after/plugin/lsp.vim b/.vim/after/plugin/lsp.vim
index 9183f7d..a5f6e73 100644
--- a/.vim/after/plugin/lsp.vim
+++ b/.vim/after/plugin/lsp.vim
@@ -17,6 +17,14 @@ if executable('gopls')
\ })
endif
+if executable('clangd')
+ au User lsp_setup call lsp#register_server({
+ \ 'name': 'clangd',
+ \ 'cmd': {server_info->['clangd']},
+ \ 'allowlist': ['c', 'cpp'],
+ \ })
+endif
+
function! s:on_lsp_buffer_enabled() abort
setlocal omnifunc=lsp#complete
if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif