diff options
Diffstat (limited to '_config/200-lsp.vim')
-rw-r--r-- | _config/200-lsp.vim | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/_config/200-lsp.vim b/_config/200-lsp.vim index 4cfcbb2..a88fa20 100644 --- a/_config/200-lsp.vim +++ b/_config/200-lsp.vim @@ -23,9 +23,20 @@ let g:lsp_settings = { autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif -nmap gd <plug>(lsp-definition) -nmap gD <plug>(lsp-references) -nmap K <plug>(lsp-hover) -nmap ]s <plug>(lsp-next-error) -nmap [s <plug>(lsp-previous-error) +function! s:on_lsp_buffer_enabled() abort + setlocal omnifunc=lsp#complete + setlocal signcolumn=yes + nmap <buffer> gd <plug>(lsp-definition) + nmap <buffer> <f2> <plug>(lsp-rename) + nmap <buffer> gD <plug>(lsp-references) + nmap <buffer> K <plug>(lsp-hover) + nmap <buffer> ]s <plug>(lsp-next-error) + nmap <buffer> [s <plug>(lsp-previous-error) +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 |