aboutsummaryrefslogtreecommitdiff
path: root/.vim
diff options
context:
space:
mode:
Diffstat (limited to '.vim')
-rw-r--r--.vim/after/plugin/lsp.vim42
-rw-r--r--.vim/after/plugin/minpac.vim6
-rw-r--r--.vim/after/plugin/mucomplete.vim5
3 files changed, 51 insertions, 2 deletions
diff --git a/.vim/after/plugin/lsp.vim b/.vim/after/plugin/lsp.vim
new file mode 100644
index 0000000..0f53146
--- /dev/null
+++ b/.vim/after/plugin/lsp.vim
@@ -0,0 +1,42 @@
+let g:lsp_diagnostics_enabled = 0
+let g:lsp_document_code_action_signs_enabled = 0
+
+if executable('pyls')
+ au User lsp_setup call lsp#register_server({
+ \ 'name': 'pyls',
+ \ 'cmd': {server_info->['pyls']},
+ \ 'allowlist': ['python'],
+ \ })
+endif
+
+if executable('gopls')
+ au User lsp_setup call lsp#register_server({
+ \ 'name': 'gopls',
+ \ 'cmd': {server_info->['gopls']},
+ \ 'allowlist': ['go'],
+ \ })
+endif
+
+function! s:on_lsp_buffer_enabled() abort
+ setlocal omnifunc=lsp#complete
+ setlocal signcolumn=yes
+ if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif
+ nmap <buffer> gd <plug>(lsp-definition)
+ nmap <buffer> gs <plug>(lsp-document-symbol-search)
+ nmap <buffer> gS <plug>(lsp-workspace-symbol-search)
+ nmap <buffer> gr <plug>(lsp-references)
+ nmap <buffer> gi <plug>(lsp-implementation)
+ nmap <buffer> gy <plug>(lsp-type-definition)
+ nmap <buffer> <leader>rn <plug>(lsp-rename)
+ " nmap <buffer> [g <plug>(lsp-previous-diagnostic)
+ " nmap <buffer> ]g <plug>(lsp-next-diagnostic)
+ nmap <buffer> K <plug>(lsp-hover)
+
+ let g:lsp_format_sync_timeout = 1000
+ autocmd! BufWritePre *.rs,*.go call execute('LspDocumentFormatSync')
+endfunction
+
+augroup lsp_install
+ au!
+ autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
+augroup END
diff --git a/.vim/after/plugin/minpac.vim b/.vim/after/plugin/minpac.vim
index 50d839c..1aef9d0 100644
--- a/.vim/after/plugin/minpac.vim
+++ b/.vim/after/plugin/minpac.vim
@@ -15,11 +15,13 @@ function! InitMinpac() abort
call minpac#add('https://github.com/k-takata/minpac', {'type': 'opt'})
- call minpac#add('https://github.com/ycm-core/YouCompleteMe',
- \ {'do': function('s:build_ycm')})
+ " call minpac#add('https://github.com/ycm-core/YouCompleteMe',
+ " \ {'do': function('s:build_ycm')})
+ call minpac#add('https://github.com/lifepillar/vim-mucomplete', {'type': 'opt'})
call minpac#add('https://github.com/dense-analysis/ale.git', {'type': 'opt'})
call minpac#add('https://github.com/SirVer/ultisnips.git', {'type': 'opt'})
call minpac#add('https://github.com/honza/vim-snippets')
+ call minpac#add('https://github.com/prabirshrestha/vim-lsp')
call minpac#add('https://github.com/ludovicchabant/vim-gutentags.git')
call minpac#add('https://github.com/easymotion/vim-easymotion.git')
diff --git a/.vim/after/plugin/mucomplete.vim b/.vim/after/plugin/mucomplete.vim
new file mode 100644
index 0000000..7d16cfb
--- /dev/null
+++ b/.vim/after/plugin/mucomplete.vim
@@ -0,0 +1,5 @@
+let g:mucomplete#enable_auto_at_startup = 1
+let g:mucomplete#minimum_prefix_length = 1
+let g:mucomplete#empty_text_auto = 1
+
+packadd vim-mucomplete