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#autocompletion_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 execute "inoremap ".g:jedi#autocompletion_command." " " goto / get_definition / related_names execute "noremap ".g:jedi#goto_command." :call jedi#goto()" execute "noremap ".g:jedi#get_definition_command." :call jedi#get_definition()" execute "noremap ".g:jedi#related_names_command." :call jedi#related_names()" " rename execute "noremap ".g:jedi#rename_command." :call jedi#rename()" " pydoc execute "nnoremap ".g:jedi#pydoc." :call jedi#show_pydoc()" if g:jedi#show_function_definition == 1 && has('conceal') call jedi#configure_function_definition() 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