refac(prog/nvim): improve lsp hotkeys
This commit is contained in:
parent
095fe593fd
commit
a3b91d1222
1 changed files with 12 additions and 14 deletions
|
@ -111,30 +111,28 @@ let g:NERDTreeGitStatusIndicatorMapCustom = {
|
||||||
let g:lsp_preview_max_width = 60
|
let g:lsp_preview_max_width = 60
|
||||||
let g:lsp_diagnostics_float_cursor = 1
|
let g:lsp_diagnostics_float_cursor = 1
|
||||||
|
|
||||||
" if (executable('haskell-language-server-wrapper'))
|
if (executable('haskell-language-server-wrapper'))
|
||||||
" echom "Haskell lsp installed"
|
echom "Haskell lsp installed"
|
||||||
" au User lsp_setup call lsp#register_server({
|
au User lsp_setup call lsp#register_server({
|
||||||
" \ 'name': 'haskell-language-server-wrapper',
|
\ 'name': 'haskell-language-server-wrapper',
|
||||||
" \ 'cmd': {server_info->['haskell-language-server-wrapper', 'lsp']},
|
\ 'cmd': {server_info->['haskell-language-server-wrapper', 'lsp']},
|
||||||
" \ 'whitelist': ['haskell'],
|
\ 'whitelist': ['haskell'],
|
||||||
" \ })
|
\ })
|
||||||
" endif
|
endif
|
||||||
|
|
||||||
function! s:on_lsp_buffer_enabled() abort
|
function! s:on_lsp_buffer_enabled() abort
|
||||||
setlocal omnifunc=lsp#complete
|
setlocal omnifunc=lsp#complete
|
||||||
if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif
|
if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif
|
||||||
nmap <buffer> gd <plug>(lsp-definition)
|
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> gr <plug>(lsp-references)
|
||||||
nmap <buffer> gi <plug>(lsp-implementation)
|
nmap <buffer> gi <plug>(lsp-implementation)
|
||||||
nmap <buffer> gt <plug>(lsp-type-definition)
|
"nmap <buffer> gt <plug>(lsp-type-definition)
|
||||||
nmap <buffer> <leader>rn <plug>(lsp-rename)
|
nmap <buffer> <localleader>n <plug>(lsp-rename)
|
||||||
|
nmap <buffer> <localleader>a <plug>(lsp-code-action)
|
||||||
|
nmap <buffer> <localleader>h <plug>(lsp-signature-help)
|
||||||
nmap <buffer> [g <plug>(lsp-previous-diagnostic)
|
nmap <buffer> [g <plug>(lsp-previous-diagnostic)
|
||||||
nmap <buffer> ]g <plug>(lsp-next-diagnostic)
|
nmap <buffer> ]g <plug>(lsp-next-diagnostic)
|
||||||
nmap <buffer> K <plug>(lsp-hover)
|
nmap <buffer> K <plug>(lsp-hover)
|
||||||
nnoremap <buffer> <expr><c-f> lsp#scroll(+4)
|
|
||||||
nnoremap <buffer> <expr><c-d> lsp#scroll(-4)
|
|
||||||
" refer to doc to add more commands
|
" refer to doc to add more commands
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue