mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-12 09:35:40 +08:00
feat(lang#python): add g D
to jump type definition
- fix `g d` lsp checking - add `g D` for type def jumping
This commit is contained in:
parent
6767f4da4e
commit
aa3deb1f25
@ -50,6 +50,7 @@
|
|||||||
" Key Function
|
" Key Function
|
||||||
" --------------------------------
|
" --------------------------------
|
||||||
" SPC l r run current file
|
" SPC l r run current file
|
||||||
|
" g d jump to definition
|
||||||
" <
|
" <
|
||||||
"
|
"
|
||||||
" This layer also provides REPL support for python, the key bindings are:
|
" This layer also provides REPL support for python, the key bindings are:
|
||||||
@ -66,6 +67,7 @@
|
|||||||
" be used:
|
" be used:
|
||||||
" >
|
" >
|
||||||
" key binding Description
|
" key binding Description
|
||||||
|
" g D jump to type definition
|
||||||
" 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 s show line diagnostics
|
||||||
@ -217,6 +219,7 @@ function! s:language_specified_mappings() abort
|
|||||||
if SpaceVim#layers#lsp#check_filetype('python')
|
if SpaceVim#layers#lsp#check_filetype('python')
|
||||||
\ || SpaceVim#layers#lsp#check_server('pyright')
|
\ || SpaceVim#layers#lsp#check_server('pyright')
|
||||||
nnoremap <silent><buffer> K :call SpaceVim#lsp#show_doc()<CR>
|
nnoremap <silent><buffer> K :call SpaceVim#lsp#show_doc()<CR>
|
||||||
|
nnoremap <silent><buffer> gD :<C-u>call SpaceVim#lsp#go_to_typedef()<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)
|
||||||
@ -261,7 +264,8 @@ func! s:getexe() abort
|
|||||||
endf
|
endf
|
||||||
|
|
||||||
function! s:go_to_def() abort
|
function! s:go_to_def() abort
|
||||||
if !SpaceVim#layers#lsp#check_filetype('python')
|
if SpaceVim#layers#lsp#check_filetype('python')
|
||||||
|
\ || SpaceVim#layers#lsp#check_server('pyright')
|
||||||
call jedi#goto()
|
call jedi#goto()
|
||||||
else
|
else
|
||||||
call SpaceVim#lsp#go_to_def()
|
call SpaceVim#lsp#go_to_def()
|
||||||
|
@ -3540,6 +3540,7 @@ KEY BINDINGS
|
|||||||
Key Function
|
Key Function
|
||||||
--------------------------------
|
--------------------------------
|
||||||
SPC l r run current file
|
SPC l r run current file
|
||||||
|
g d jump to definition
|
||||||
<
|
<
|
||||||
|
|
||||||
This layer also provides REPL support for python, the key bindings are:
|
This layer also provides REPL support for python, the key bindings are:
|
||||||
@ -3556,6 +3557,7 @@ If the lsp layer is enabled for python, the following key bindings can be
|
|||||||
used:
|
used:
|
||||||
>
|
>
|
||||||
key binding Description
|
key binding Description
|
||||||
|
g D jump to type definition
|
||||||
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 s show line diagnostics
|
||||||
|
Loading…
x
Reference in New Issue
Block a user