aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2021-10-10 10:11:13 +0800
committerGuangxiong Lin <[email protected]>2021-10-10 10:11:13 +0800
commitef00232b6df90dbba49ff5ddbd6ef1543a297545 (patch)
tree3893c3badbc223d89fce4f23c252bf4031f0ccfd
parentdfb05c72600a40986a09cc406f27fd385ee185ab (diff)
downloaddotfiles-ef00232b6df90dbba49ff5ddbd6ef1543a297545.tar.gz
dotfiles-ef00232b6df90dbba49ff5ddbd6ef1543a297545.tar.bz2
dotfiles-ef00232b6df90dbba49ff5ddbd6ef1543a297545.zip
Update vim config
-rw-r--r--.vim/plugin/editorconfig.vim2
-rw-r--r--.vim/plugin/gutentags.vim19
-rw-r--r--.vim/plugin/init.vim9
-rw-r--r--.vim/plugin/lsp.vim9
-rw-r--r--.vim/plugin/rooter.vim1
5 files changed, 33 insertions, 7 deletions
diff --git a/.vim/plugin/editorconfig.vim b/.vim/plugin/editorconfig.vim
new file mode 100644
index 0000000..70a4c16
--- /dev/null
+++ b/.vim/plugin/editorconfig.vim
@@ -0,0 +1,2 @@
+let g:EditorConfig_exclude_patterns = ['fugitive://.*', 'scp://.*']
+au FileType gitcommit let b:EditorConfig_disable = 1
diff --git a/.vim/plugin/gutentags.vim b/.vim/plugin/gutentags.vim
new file mode 100644
index 0000000..25bfaaf
--- /dev/null
+++ b/.vim/plugin/gutentags.vim
@@ -0,0 +1,19 @@
+let g:gutentags_project_root = ['.root', '.svn', '.git', '.hg', '.project']
+let g:gutentags_ctags_tagfile = '.tags'
+let g:gutentags_cache_dir = expand('~/.cache/tags')
+let g:gutentags_ctags_extra_args = ['--fields=+niazS', '--extras=+q']
+let g:gutentags_ctags_extra_args += ['--c++-kinds=+px']
+let g:gutentags_ctags_extra_args += ['--c-kinds=+px']
+let g:gutentags_ctags_extra_args += ['--output-format=e-ctags']
+let g:gutentags_define_advanced_commands = 1
+
+let $GTAGSLABEL = 'native-pygments'
+let $GTAGSCONF = '/usr/local/share/gtags/gtags.conf'
+
+let g:gutentags_modules = []
+if executable('ctags')
+ let g:gutentags_modules += ['ctags']
+endif
+if executable('gtags') && executable('gtags-cscope')
+ let g:gutentags_modules += ['gtags_cscope']
+endif
diff --git a/.vim/plugin/init.vim b/.vim/plugin/init.vim
index 0c2f2dd..2f5afd4 100644
--- a/.vim/plugin/init.vim
+++ b/.vim/plugin/init.vim
@@ -32,13 +32,6 @@ Plug 'godlygeek/tabular'
Plug 'airblade/vim-rooter'
Plug 'ludovicchabant/vim-gutentags'
-let g:gutentags_project_root = ['.root', '.svn', '.git', '.hg', '.project']
-let g:gutentags_ctags_tagfile = '.tags'
-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']
-
-
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
@@ -53,6 +46,8 @@ Plug 'easymotion/vim-easymotion'
map <Space> <Plug>(easymotion-prefix)
+Plug 'editorconfig/editorconfig-vim'
+
" Language specific
Plug 'habamax/vim-godot', {'for': 'gdscript'}
Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'}
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
diff --git a/.vim/plugin/rooter.vim b/.vim/plugin/rooter.vim
new file mode 100644
index 0000000..bb07c0a
--- /dev/null
+++ b/.vim/plugin/rooter.vim
@@ -0,0 +1 @@
+let g:rooter_patterns = ['.git']