From a9793c04508fdb582d69138dde04583c9f4e5c0f Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Fri, 8 Apr 2022 00:42:57 +0800 Subject: Try removing ycm (vim) --- .vim/after/plugin/lsp.vim | 42 ++++++++++++++++++++++++++++++++++++++++ .vim/after/plugin/minpac.vim | 6 ++++-- .vim/after/plugin/mucomplete.vim | 5 +++++ 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 .vim/after/plugin/lsp.vim create mode 100644 .vim/after/plugin/mucomplete.vim (limited to '.vim') 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 gd (lsp-definition) + nmap gs (lsp-document-symbol-search) + nmap gS (lsp-workspace-symbol-search) + nmap gr (lsp-references) + nmap gi (lsp-implementation) + nmap gy (lsp-type-definition) + nmap rn (lsp-rename) + " nmap [g (lsp-previous-diagnostic) + " nmap ]g (lsp-next-diagnostic) + nmap K (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 -- cgit v1.2.3