aboutsummaryrefslogtreecommitdiff
path: root/core/plugins.vim
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2020-11-25 01:07:50 +0800
committerjdhao <jdhao@hotmail.com>2020-11-25 01:07:50 +0800
commit283356ee526c775469e52b8716c31ddba2cceee2 (patch)
tree14628fc71b720b75cfc624f94813e65947675e99 /core/plugins.vim
parent9a7ac4c9d191117aa86808de8c056338bca1dc09 (diff)
Initial support for C++
Diffstat (limited to 'core/plugins.vim')
-rw-r--r--core/plugins.vim26
1 files changed, 25 insertions, 1 deletions
diff --git a/core/plugins.vim b/core/plugins.vim
index 78bfb74..0df68f2 100644
--- a/core/plugins.vim
+++ b/core/plugins.vim
@@ -44,6 +44,9 @@ Plug 'machakann/vim-swap'
" IDE for Lisp
" Plug 'kovisoft/slimv'
Plug 'vlime/vlime', {'rtp': 'vim/', 'for': 'lisp'}
+
+" C++ semantic highlighting
+Plug 'jackguo380/vim-lsp-cxx-highlight'
"}}
"{{ Search related plugins
@@ -390,6 +393,24 @@ if executable('pyls')
augroup END
endif
+if executable('ccls')
+ augroup ccls_setup
+ autocmd!
+ 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', 'compile_commands.json', '.git/']))},
+ \ 'initialization_options': {
+ \ 'highlight': { 'lsRanges' : v:true },
+ \ 'cache': {'directory': stdpath('cache') . '/ccls' },
+ \ },
+ \ 'whitelist': ['c', 'cpp', 'objc', 'objcpp', 'cc'],
+ \ })
+ augroup END
+endif
+
if executable('vim-language-server')
augroup LspVim
autocmd!
@@ -546,9 +567,12 @@ endif
"{{ Navigation and tags
""""""""""""""""""""""""""" gutentags settings """"""""""""""""""""""""""""""
-let g:gutentags_ctags_exclude = ['*.md', '*.html', '*.json', '*.toml', '*.css', '*.js',]
" The path to store tags files, instead of in the project root.
let g:gutentags_cache_dir = stdpath('cache') . '/ctags'
+let g:gutentags_ctags_extra_args = ['--fields=+niazS', '--extra=+q']
+let g:gutentags_ctags_extra_args += ['--c++-kinds=+px']
+let g:gutentags_ctags_extra_args += ['--c-kinds=+px']
+let g:gutentags_ctags_exclude = ['*.md', '*.html', '*.json', '*.toml', '*.css', '*.js',]
""""""""""""""""""""""""""" vista settings """"""""""""""""""""""""""""""""""
let g:vista#renderer#icons = {