From 144b3386e9efbcc52c4233e59f5995b0f0be0fc1 Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Sat, 9 Apr 2022 14:03:41 +0800 Subject: Use clangd to help complete c-family language (vim) --- .vim/after/plugin/lsp.vim | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to '.vim/after/plugin/lsp.vim') 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 -- cgit v1.2.3