mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-09 17:40:05 +08:00
Add lsp support for python
This commit is contained in:
parent
18cf0d996d
commit
781fa2c259
@ -10,12 +10,14 @@
|
|||||||
function! SpaceVim#layers#lang#python#plugins() abort
|
function! SpaceVim#layers#lang#python#plugins() abort
|
||||||
let plugins = []
|
let plugins = []
|
||||||
" python
|
" python
|
||||||
|
if !SpaceVim#layers#lsp#check_filetype('python')
|
||||||
if has('nvim')
|
if has('nvim')
|
||||||
call add(plugins, ['zchee/deoplete-jedi', { 'on_ft' : 'python'}])
|
call add(plugins, ['zchee/deoplete-jedi', { 'on_ft' : 'python'}])
|
||||||
else
|
else
|
||||||
call add(plugins, ['davidhalter/jedi-vim', { 'on_ft' : 'python',
|
call add(plugins, ['davidhalter/jedi-vim', { 'on_ft' : 'python',
|
||||||
\ 'if' : has('python') || has('python3')}])
|
\ 'if' : has('python') || has('python3')}])
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
call add(plugins, ['Vimjas/vim-python-pep8-indent',
|
call add(plugins, ['Vimjas/vim-python-pep8-indent',
|
||||||
\ { 'on_ft' : 'python'}])
|
\ { 'on_ft' : 'python'}])
|
||||||
call add(plugins, ['tell-k/vim-autoflake', {'merged' : 0}])
|
call add(plugins, ['tell-k/vim-autoflake', {'merged' : 0}])
|
||||||
@ -62,4 +64,12 @@ function! s:language_specified_mappings() abort
|
|||||||
call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 's'],
|
call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 's'],
|
||||||
\ 'call SpaceVim#plugins#repl#send("selection")',
|
\ 'call SpaceVim#plugins#repl#send("selection")',
|
||||||
\ 'send selection and keep code buffer focused', 1)
|
\ 'send selection and keep code buffer focused', 1)
|
||||||
|
if SpaceVim#layers#lsp#check_filetype('python')
|
||||||
|
nnoremap <silent><buffer> K :call SpaceVim#lsp#show_doc()<CR>
|
||||||
|
|
||||||
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'd'],
|
||||||
|
\ 'call SpaceVim#lsp#show_doc()', 'show_document', 1)
|
||||||
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'e'],
|
||||||
|
\ 'call SpaceVim#lsp#rename()', 'rename symbol', 1)
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
Loading…
Reference in New Issue
Block a user