summaryrefslogtreecommitdiffstats
path: root/.config/nvim/plug-config/vim-lsp.vim
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/plug-config/vim-lsp.vim')
-rw-r--r--.config/nvim/plug-config/vim-lsp.vim39
1 files changed, 26 insertions, 13 deletions
diff --git a/.config/nvim/plug-config/vim-lsp.vim b/.config/nvim/plug-config/vim-lsp.vim
index 4accf36..d12f315 100644
--- a/.config/nvim/plug-config/vim-lsp.vim
+++ b/.config/nvim/plug-config/vim-lsp.vim
@@ -1,16 +1,29 @@
-if executable('/usr/local/llvm10/bin/clangd')
- augroup lsp_clangd
- autocmd!
- autocmd User lsp_setup call lsp#register_server({
- \ 'name': 'clangd',
- \ 'cmd': {server_info->['clangd']},
- \ 'whitelist': ['c', 'cpp', 'objc', 'objcpp']
- \ })
- autocmd FileType c setlocal omnifunc=lsp#complete
- autocmd FileType cpp setlocal omnifunc=lsp#complete
- autocmd FileType objc setlocal omnifunc=lsp#complete
- autocmd FileType objcpp setlocal omnifunc=lsp#complete
- augroup end
+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(), '.ccls'))},
+ \ 'initialization_options': {
+ \ 'highlight': { 'lsRanges' : v:true },
+ \ },
+ \ 'whitelist': ['c', 'cpp', 'objc', 'objcpp', 'cc'],
+ \ })
endif
+autocmd FileType c setlocal omnifunc=lsp#complete
+autocmd FileType cpp setlocal omnifunc=lsp#complete
+autocmd FileType objc setlocal omnifunc=lsp#complete
+autocmd FileType objcpp setlocal omnifunc=lsp#complete
+
let g:lsp_signs_priority = 10
+let g:lsp_textprop_enabled = 1
+let g:lsp_cxx_hl_use_text_props = 1
+highlight LspCxxHlSymStruct ctermfg=Yellow guifg=Yellow
+highlight LspCxxHlSymClass ctermfg=Yellow guifg=Yellow
+highlight LspCxxHlSymField ctermfg=Blue guifg=Blue
+highlight LspCxxHlSymParameter ctermfg=LightYellow guifg=LightYellow
+highlight LspCxxHlSymVariableStatic ctermfg=LightRed guifg=LightRed
+highlight LspErrorHighlight cterm=undercurl gui=undercurl ctermfg=DarkRed guifg=DarkRed
+highlight LspWarningHighlight cterm=underline gui=underline ctermfg=DarkRed guifg=DarkRed
+highlight LspInformationHighlight cterm=underline gui=underline ctermfg=Green guifg=Green
+highlight LspHintHighlight term=italic cterm=italic gui=italic ctermfg=Green guifg=Green