mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-14 10:45:42 +08:00
feat(lang#rust): add more lsp key bindings for rust
This commit is contained in:
parent
773aa07b46
commit
da40455f5c
@ -10,7 +10,8 @@
|
|||||||
""
|
""
|
||||||
" @section lang#rust, layers-lang-rust
|
" @section lang#rust, layers-lang-rust
|
||||||
" @parentsection layers
|
" @parentsection layers
|
||||||
" This layer is for Rust development.
|
" `lang#rust` layers provides rust programming language support for SpaceVim.
|
||||||
|
" This layers includes syntax highlighting, code runner, REPL for rust.
|
||||||
"
|
"
|
||||||
" Requirements:
|
" Requirements:
|
||||||
"
|
"
|
||||||
@ -81,6 +82,20 @@
|
|||||||
" SPC l s s send selection text
|
" SPC l s s send selection text
|
||||||
" <
|
" <
|
||||||
"
|
"
|
||||||
|
" If the lsp layer is enabled for python, the following key bindings can
|
||||||
|
" be used:
|
||||||
|
" >
|
||||||
|
" key binding Description
|
||||||
|
" g D jump to type definition
|
||||||
|
" SPC l e rename symbol
|
||||||
|
" SPC l x show references
|
||||||
|
" SPC l s show line diagnostics
|
||||||
|
" SPC l d show document
|
||||||
|
" K show document
|
||||||
|
" SPC l w l list workspace folder
|
||||||
|
" SPC l w a add workspace folder
|
||||||
|
" SPC l w r remove workspace folder
|
||||||
|
" <
|
||||||
|
|
||||||
if exists('s:racer_cmd')
|
if exists('s:racer_cmd')
|
||||||
finish
|
finish
|
||||||
@ -182,12 +197,23 @@ function! s:language_specified_mappings() abort
|
|||||||
|
|
||||||
if SpaceVim#layers#lsp#check_filetype('rust')
|
if SpaceVim#layers#lsp#check_filetype('rust')
|
||||||
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 documentation', 1)
|
\ 'call SpaceVim#lsp#show_doc()', 'show-document', 1)
|
||||||
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'x'],
|
||||||
|
\ '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', 'u'],
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 's'],
|
||||||
\ 'call SpaceVim#lsp#references()', 'show references', 1)
|
\ 'call SpaceVim#lsp#show_line_diagnostics()', 'show-line-diagnostics', 1)
|
||||||
|
let g:_spacevim_mappings_space.l.w = {'name' : '+Workspace'}
|
||||||
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'w', 'l'],
|
||||||
|
\ 'call SpaceVim#lsp#list_workspace_folder()', 'list-workspace-folder', 1)
|
||||||
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'w', 'a'],
|
||||||
|
\ 'call SpaceVim#lsp#add_workspace_folder()', 'add-workspace-folder', 1)
|
||||||
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'w', 'r'],
|
||||||
|
\ 'call SpaceVim#lsp#remove_workspace_folder()', 'remove-workspace-folder', 1)
|
||||||
else
|
else
|
||||||
nmap <silent><buffer> K <Plug>(rust-doc)
|
nmap <silent><buffer> K <Plug>(rust-doc)
|
||||||
call SpaceVim#mapping#space#langSPC('nmap', ['l', 'd'],
|
call SpaceVim#mapping#space#langSPC('nmap', ['l', 'd'],
|
||||||
|
@ -3782,7 +3782,8 @@ This layer also provides REPL support for ruby, the key bindings are:
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
LANG#RUST *SpaceVim-layers-lang-rust*
|
LANG#RUST *SpaceVim-layers-lang-rust*
|
||||||
|
|
||||||
This layer is for Rust development.
|
`lang#rust` layers provides rust programming language support for SpaceVim.
|
||||||
|
This layers includes syntax highlighting, code runner, REPL for rust.
|
||||||
|
|
||||||
Requirements:
|
Requirements:
|
||||||
|
|
||||||
@ -3859,6 +3860,20 @@ This layer also provides REPL support for rust, the key bindings are:
|
|||||||
SPC l s s send selection text
|
SPC l s s send selection text
|
||||||
<
|
<
|
||||||
|
|
||||||
|
If the lsp layer is enabled for python, the following key bindings can be
|
||||||
|
used:
|
||||||
|
>
|
||||||
|
key binding Description
|
||||||
|
g D jump to type definition
|
||||||
|
SPC l e rename symbol
|
||||||
|
SPC l x show references
|
||||||
|
SPC l s show line diagnostics
|
||||||
|
SPC l d show document
|
||||||
|
K show document
|
||||||
|
SPC l w l list workspace folder
|
||||||
|
SPC l w a add workspace folder
|
||||||
|
SPC l w r remove workspace folder
|
||||||
|
<
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
LANG#SCALA *SpaceVim-layers-lang-scala*
|
LANG#SCALA *SpaceVim-layers-lang-scala*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user