diff --git a/after/ftplugin/python/jedi.vim b/after/ftplugin/python/jedi.vim index efc5ec9..70a7a85 100644 --- a/after/ftplugin/python/jedi.vim +++ b/after/ftplugin/python/jedi.vim @@ -1,3 +1,16 @@ -" We need our own omnifunc, so this overrides the omnifunc set by -" $VIMRUNTIME/ftplugin/python.vim. -setlocal omnifunc=jedi#completions +if g:jedi#auto_initialization + if g:jedi#completions_enabled + " We need our own omnifunc, so this overrides the omnifunc set by + " $VIMRUNTIME/ftplugin/python.vim. + setlocal omnifunc=jedi#completions + + " map ctrl+space for autocompletion + if g:jedi#completions_command == "" + " in terminals, sometimes equals + inoremap jedi#complete_string(0) + endif + if g:jedi#completions_command != "" + execute "inoremap ".g:jedi#completions_command." jedi#complete_string(0)" + endif + endif +endif diff --git a/ftplugin/python/jedi.vim b/ftplugin/python/jedi.vim index 2da879a..f1a69d6 100644 --- a/ftplugin/python/jedi.vim +++ b/ftplugin/python/jedi.vim @@ -6,17 +6,6 @@ endif " ------------------------------------------------------------------------ if g:jedi#auto_initialization - if g:jedi#completions_enabled - " map ctrl+space for autocompletion - if g:jedi#completions_command == "" - " in terminals, sometimes equals - inoremap jedi#complete_string(0) - endif - if g:jedi#completions_command != "" - execute "inoremap ".g:jedi#completions_command." jedi#complete_string(0)" - endif - endif - " goto / get_definition / usages if g:jedi#goto_assignments_command != '' execute "noremap ".g:jedi#goto_assignments_command." :call jedi#goto_assignments()"