diff options
author | Guangxiong Lin <[email protected]> | 2021-10-10 10:11:13 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2021-10-10 10:11:13 +0800 |
commit | ef00232b6df90dbba49ff5ddbd6ef1543a297545 (patch) | |
tree | 3893c3badbc223d89fce4f23c252bf4031f0ccfd /.vim/plugin/lsp.vim | |
parent | dfb05c72600a40986a09cc406f27fd385ee185ab (diff) | |
download | dotfiles-ef00232b6df90dbba49ff5ddbd6ef1543a297545.tar.gz dotfiles-ef00232b6df90dbba49ff5ddbd6ef1543a297545.tar.bz2 dotfiles-ef00232b6df90dbba49ff5ddbd6ef1543a297545.zip |
Update vim config
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 |