1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-03-13 18:25:42 +08:00

feat(lang#vim): add SPC l s key binding

Add `SPC l s` to show line diagnostics when lsp layer is enabled
for vim script.
This commit is contained in:
Shidong Wang 2021-10-05 19:49:17 +08:00
parent 9d374eaa3c
commit e8a75bc7e2
No known key found for this signature in database
GPG Key ID: 41BB7053E835C848
3 changed files with 9 additions and 2 deletions

View File

@ -40,6 +40,7 @@
" key binding Description " key binding Description
" SPC l e rename symbol " SPC l e rename symbol
" SPC l x show references " SPC l x show references
" SPC l s show line diagnostics
" SPC l d show document " SPC l d show document
" K show document " K show document
" < " <
@ -149,11 +150,13 @@ function! s:language_specified_mappings() abort
nnoremap <silent><buffer> K :call SpaceVim#lsp#show_doc()<CR> nnoremap <silent><buffer> K :call SpaceVim#lsp#show_doc()<CR>
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'd'], call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'd'],
\ 'call SpaceVim#lsp#show_doc()', 'show_document', 1) \ 'call SpaceVim#lsp#show_doc()', 'show-document', 1)
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'x'], call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'x'],
\ 'call SpaceVim#lsp#references()', 'show-references', 1) \ 'call SpaceVim#lsp#references()', 'show-references', 1)
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'e'], call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'e'],
\ 'call SpaceVim#lsp#rename()', 'rename symbol', 1) \ 'call SpaceVim#lsp#rename()', 'rename-symbol', 1)
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 's'],
\ 'call SpaceVim#lsp#show_line_diagnostics()', 'show-line-diagnostics', 1)
endif endif
endfunction endfunction

View File

@ -47,6 +47,9 @@ if (has('nvim-0.5.0') && s:NVIM_VERSION.is_release_version()) || has('nvim-0.6.0
function! SpaceVim#lsp#go_to_impl() abort function! SpaceVim#lsp#go_to_impl() abort
lua vim.lsp.buf.implementation() lua vim.lsp.buf.implementation()
endfunction endfunction
function! SpaceVim#lsp#show_line_diagnostics() abort
lua vim.lsp.diagnostic.show_line_diagnostics()
endfunction
elseif SpaceVim#layers#isLoaded('autocomplete') && get(g:, 'spacevim_autocomplete_method') ==# 'coc' elseif SpaceVim#layers#isLoaded('autocomplete') && get(g:, 'spacevim_autocomplete_method') ==# 'coc'
" use coc.nvim " use coc.nvim
let s:coc_language_servers = {} let s:coc_language_servers = {}

View File

@ -4263,6 +4263,7 @@ used:
key binding Description key binding Description
SPC l e rename symbol SPC l e rename symbol
SPC l x show references SPC l x show references
SPC l s show line diagnostics
SPC l d show document SPC l d show document
K show document K show document
< <