diff options
Diffstat (limited to '.vim/plugin/lsp.vim')
-rw-r--r-- | .vim/plugin/lsp.vim | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/.vim/plugin/lsp.vim b/.vim/plugin/lsp.vim index 0cd0a36..cc40ee6 100644 --- a/.vim/plugin/lsp.vim +++ b/.vim/plugin/lsp.vim @@ -5,6 +5,15 @@ if executable('gopls') \ 'allowlist': ['go'], \ }) endif +if executable('ccls') + au User lsp_setup call lsp#register_server({ + \ 'name': 'ccls', + \ 'cmd': {server_info->['ccls']}, + \ 'root_uri': {server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'compile_commands.json'))}, + \ 'initialization_options': {'cache': {'directory': expand('~/.cache/ccls') }}, + \ 'allowlist': ['c', 'cpp', 'objc', 'objcpp', 'cc'], + \ }) +endif function! s:on_lsp_buffer_enabled() abort setlocal omnifunc=lsp#complete |