diff options
author | Guangxiong Lin <[email protected]> | 2022-04-08 00:42:57 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2022-04-08 00:42:57 +0800 |
commit | a9793c04508fdb582d69138dde04583c9f4e5c0f (patch) | |
tree | c47443766be74ec248f1bbc1825d6cec1ae3708a | |
parent | 40e266a131d8bfc9f2f48c5e40846436a9c9e64f (diff) | |
download | dotfiles-a9793c04508fdb582d69138dde04583c9f4e5c0f.tar.gz dotfiles-a9793c04508fdb582d69138dde04583c9f4e5c0f.tar.bz2 dotfiles-a9793c04508fdb582d69138dde04583c9f4e5c0f.zip |
Try removing ycm (vim)
-rw-r--r-- | .vim/after/plugin/lsp.vim | 42 | ||||
-rw-r--r-- | .vim/after/plugin/minpac.vim | 6 | ||||
-rw-r--r-- | .vim/after/plugin/mucomplete.vim | 5 | ||||
-rw-r--r-- | .vimrc | 4 |
4 files changed, 54 insertions, 3 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 @@ -30,8 +30,10 @@ set nofoldenable set hidden -set completeopt=menu,menuone,popup +set completeopt=menu,menuone,popup,noinsert,noselect set completepopup=align:menu,border:off,highlight:WildMenu +set shortmess+=c +set belloff+=ctrlg " diff set diffopt+=followwrap,algorithm:patience |