diff options
Diffstat (limited to '.vim')
-rw-r--r-- | .vim/after/plugin/lsp.vim | 8 | ||||
-rw-r--r-- | .vim/after/plugin/mucomplete.vim | 9 |
2 files changed, 17 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 diff --git a/.vim/after/plugin/mucomplete.vim b/.vim/after/plugin/mucomplete.vim index 5287c25..cdfbe11 100644 --- a/.vim/after/plugin/mucomplete.vim +++ b/.vim/after/plugin/mucomplete.vim @@ -7,6 +7,15 @@ let g:mucomplete#can_complete = {} let s:default_cond = { t -> t =~# '\%(\.\)$' } let g:mucomplete#can_complete.default = { 'omni': s:default_cond } +let s:c_cond = { t -> t =~# '\%(\.\|->\)$' } +let g:mucomplete#can_complete.c = { 'omni': s:c_cond } +let g:mucomplete#can_complete.objc = { 'omni': s:c_cond } + +let s:cpp_cond = { t -> t =~# '\%(\.\|->\|::\)$' } +let g:mucomplete#can_complete.cpp = { 'omni': s:cpp_cond } +let g:mucomplete#can_complete.objcpp = { 'omni': s:cpp_cond } +let g:mucomplete#can_complete.cuda = { 'omni': s:cpp_cond } + let g:mucomplete#chains = {} let g:mucomplete#chains.default = \ [ 'ulti', 'user', 'omni', 'tags', 'keyn', 'path' ] |