Use vim-lsp

This commit is contained in:
2020-10-11 17:55:02 +02:00
parent 6f5ba10aa6
commit efc29ec3b9
5 changed files with 301 additions and 2864 deletions

View File

@@ -178,9 +178,39 @@ autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in
let g:EditorConfig_max_line_indicator = 'none'
" let g:EditorConfig_preserve_formatoptions = 1
" vim current word
let g:vim_current_word#highlight_current_word = 0
hi default link CurrentWordTwins CursorColumn
" vista
let g:vista#renderer#enable_icon = 0
" vim-lsp
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> gr <plug>(lsp-references)
nmap <buffer> gi <plug>(lsp-implementation)
nmap <buffer> gt <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)
" refer to doc to add more commands
endfunction
augroup lsp_install
au!
" call s:on_lsp_buffer_enabled only for languages that has the server registered.
autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
augroup END
let g:lsp_auto_enable = 0
command -nargs=0 LspStart call lsp#activate()