let b:did_ftplugin = 1 if !has('python') && !has('python3') finish endif " ------------------------------------------------------------------------ " Initialization of jedi-vim " ------------------------------------------------------------------------ if g:jedi#auto_initialization setlocal omnifunc=jedi#completions " map ctrl+space for autocompletion if g:jedi#completions_command == "" " in terminals, sometimes equals inoremap pumvisible() \|\| &omnifunc == '' ? \ "\C-n>" : \ "\C-x>\C-o>=pumvisible() ?" . \ "\"\\c-n>\\c-p>\\c-n>\" :" . \ "\" \\bs>\\C-n>\"\" endif if g:jedi#completions_command != "" execute "inoremap ".g:jedi#completions_command." " endif " goto / get_definition / usages if g:jedi#goto_assignments_command != '' execute "noremap ".g:jedi#goto_assignments_command." :call jedi#goto_assignments()" endif if g:jedi#goto_definitions_command != '' execute "noremap ".g:jedi#goto_definitions_command." :call jedi#goto_definitions()" endif if g:jedi#usages_command != '' execute "noremap ".g:jedi#usages_command." :call jedi#usages()" endif " rename if g:jedi#rename_command != '' execute "noremap ".g:jedi#rename_command." :call jedi#rename()" endif " documentation/pydoc if g:jedi#documentation_command != '' execute "nnoremap ".g:jedi#documentation_command." :call jedi#show_documentation()" endif if g:jedi#show_call_signatures == 1 && has('conceal') call jedi#configure_call_signatures() endif end if g:jedi#auto_vim_configuration setlocal completeopt=menuone,longest,preview if len(mapcheck('', 'i')) == 0 inoremap end end if g:jedi#popup_on_dot if stridx(&completeopt, 'longest') > -1 if g:jedi#popup_select_first inoremap . .=jedi#do_popup_on_dot() ? "\C-X>\C-O>\C-N>" : "" else inoremap . .=jedi#do_popup_on_dot() ? "\C-X>\C-O>" : "" end else inoremap . .=jedi#do_popup_on_dot() ? "\C-X>\C-O>\C-P>" : "" end end if g:jedi#auto_close_doc " close preview if its still open after insert autocmd InsertLeave if pumvisible() == 0|pclose|endif end