mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-06 18:54:44 +08:00
- jedi#init_python is used to init the Python environment. - jedi#setup_py_version is the single point where PythonJedi is defined, and will configure `PythonJedi` to output an error in case initialization failed. - jedi#force_py_version_switch will throw an error when g:jedi#force_py_version is not handled (e.g. invalid or "auto" and unresolved). - When g:jedi#force_py_version is provided, it will be used always. - Use WarningMsg highlight for errors, which are centralized and handled through exceptions.
48 lines
1.6 KiB
VimL
48 lines
1.6 KiB
VimL
if !jedi#init_python()
|
|
finish
|
|
endif
|
|
" ------------------------------------------------------------------------
|
|
" Initialization of jedi-vim
|
|
" ------------------------------------------------------------------------
|
|
|
|
if g:jedi#auto_initialization
|
|
" goto / get_definition / usages
|
|
if g:jedi#goto_assignments_command != ''
|
|
execute "nnoremap <buffer> ".g:jedi#goto_assignments_command." :call jedi#goto_assignments()<CR>"
|
|
endif
|
|
if g:jedi#goto_definitions_command != ''
|
|
execute "nnoremap <buffer> ".g:jedi#goto_definitions_command." :call jedi#goto_definitions()<CR>"
|
|
endif
|
|
if g:jedi#usages_command != ''
|
|
execute "nnoremap <buffer> ".g:jedi#usages_command." :call jedi#usages()<CR>"
|
|
endif
|
|
" rename
|
|
if g:jedi#rename_command != ''
|
|
execute "nnoremap <buffer> ".g:jedi#rename_command." :call jedi#rename()<CR>"
|
|
endif
|
|
" documentation/pydoc
|
|
if g:jedi#documentation_command != ''
|
|
execute "nnoremap <silent> <buffer>".g:jedi#documentation_command." :call jedi#show_documentation()<CR>"
|
|
endif
|
|
|
|
if g:jedi#show_call_signatures > 0 && has('conceal')
|
|
call jedi#configure_call_signatures()
|
|
endif
|
|
|
|
if g:jedi#completions_enabled == 1
|
|
inoremap <silent> <buffer> . .<C-R>=jedi#complete_string(1)<CR>
|
|
endif
|
|
|
|
if g:jedi#auto_close_doc
|
|
" close preview if its still open after insert
|
|
autocmd InsertLeave <buffer> if pumvisible() == 0|pclose|endif
|
|
endif
|
|
endif
|
|
|
|
if g:jedi#auto_vim_configuration
|
|
setlocal completeopt=menuone,longest,preview
|
|
if len(mapcheck('<C-c>', 'i')) == 0
|
|
inoremap <C-c> <ESC>
|
|
endif
|
|
endif
|