forked from VimPlug/jedi-vim
Use PythonJedi instead of Python as command wrapper
`:Python` is more likely to interfere with other plugins / user commands.
This commit is contained in:
@@ -4,43 +4,43 @@ scriptencoding utf-8
|
|||||||
" functions that call python code
|
" functions that call python code
|
||||||
" ------------------------------------------------------------------------
|
" ------------------------------------------------------------------------
|
||||||
function! jedi#goto_assignments()
|
function! jedi#goto_assignments()
|
||||||
Python jedi_vim.goto()
|
PythonJedi jedi_vim.goto()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! jedi#goto_definitions()
|
function! jedi#goto_definitions()
|
||||||
Python jedi_vim.goto(is_definition=True)
|
PythonJedi jedi_vim.goto(is_definition=True)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! jedi#usages()
|
function! jedi#usages()
|
||||||
Python jedi_vim.goto(is_related_name=True)
|
PythonJedi jedi_vim.goto(is_related_name=True)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! jedi#rename(...)
|
function! jedi#rename(...)
|
||||||
Python jedi_vim.rename()
|
PythonJedi jedi_vim.rename()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! jedi#completions(findstart, base)
|
function! jedi#completions(findstart, base)
|
||||||
Python jedi_vim.completions()
|
PythonJedi jedi_vim.completions()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! jedi#enable_speed_debugging()
|
function! jedi#enable_speed_debugging()
|
||||||
Python jedi_vim.jedi.set_debug_function(jedi_vim.print_to_stdout, speed=True, warnings=False, notices=False)
|
PythonJedi jedi_vim.jedi.set_debug_function(jedi_vim.print_to_stdout, speed=True, warnings=False, notices=False)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! jedi#enable_debugging()
|
function! jedi#enable_debugging()
|
||||||
Python jedi_vim.jedi.set_debug_function(jedi_vim.print_to_stdout)
|
PythonJedi jedi_vim.jedi.set_debug_function(jedi_vim.print_to_stdout)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! jedi#disable_debugging()
|
function! jedi#disable_debugging()
|
||||||
Python jedi_vim.jedi.set_debug_function(None)
|
PythonJedi jedi_vim.jedi.set_debug_function(None)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! jedi#py_import(args)
|
function! jedi#py_import(args)
|
||||||
Python jedi_vim.py_import()
|
PythonJedi jedi_vim.py_import()
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
function! jedi#py_import_completions(argl, cmdl, pos)
|
function! jedi#py_import_completions(argl, cmdl, pos)
|
||||||
Python jedi_vim.py_import_completions()
|
PythonJedi jedi_vim.py_import_completions()
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ endfun
|
|||||||
" show_documentation
|
" show_documentation
|
||||||
" ------------------------------------------------------------------------
|
" ------------------------------------------------------------------------
|
||||||
function! jedi#show_documentation()
|
function! jedi#show_documentation()
|
||||||
Python if jedi_vim.show_documentation() is None: vim.command('return')
|
PythonJedi if jedi_vim.show_documentation() is None: vim.command('return')
|
||||||
|
|
||||||
let bn = bufnr("__doc__")
|
let bn = bufnr("__doc__")
|
||||||
if bn > 0
|
if bn > 0
|
||||||
@@ -116,7 +116,7 @@ function! jedi#goto_window_on_enter()
|
|||||||
if l:data.bufnr
|
if l:data.bufnr
|
||||||
" close goto_window buffer
|
" close goto_window buffer
|
||||||
normal ZQ
|
normal ZQ
|
||||||
Python jedi_vim.new_buffer(vim.eval('bufname(l:data.bufnr)'))
|
PythonJedi jedi_vim.new_buffer(vim.eval('bufname(l:data.bufnr)'))
|
||||||
call cursor(l:data.lnum, l:data.col)
|
call cursor(l:data.lnum, l:data.col)
|
||||||
else
|
else
|
||||||
echohl WarningMsg | echo "Builtin module cannot be opened." | echohl None
|
echohl WarningMsg | echo "Builtin module cannot be opened." | echohl None
|
||||||
@@ -160,8 +160,8 @@ function! jedi#configure_call_signatures()
|
|||||||
endif
|
endif
|
||||||
autocmd InsertEnter <buffer> let g:jedi#first_col = s:save_first_col()
|
autocmd InsertEnter <buffer> let g:jedi#first_col = s:save_first_col()
|
||||||
endif
|
endif
|
||||||
autocmd InsertLeave <buffer> Python jedi_vim.clear_call_signatures()
|
autocmd InsertLeave <buffer> PythonJedi jedi_vim.clear_call_signatures()
|
||||||
autocmd CursorMovedI <buffer> Python jedi_vim.show_call_signatures()
|
autocmd CursorMovedI <buffer> PythonJedi jedi_vim.show_call_signatures()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Determine where the current window is on the screen for displaying call
|
" Determine where the current window is on the screen for displaying call
|
||||||
@@ -258,10 +258,10 @@ function! jedi#force_py_version(py_version)
|
|||||||
let g:jedi#force_py_version = a:py_version
|
let g:jedi#force_py_version = a:py_version
|
||||||
try
|
try
|
||||||
if g:jedi#force_py_version == 2
|
if g:jedi#force_py_version == 2
|
||||||
command! -nargs=1 Python python <args>
|
command! -nargs=1 PythonJedi python <args>
|
||||||
execute 'pyfile '.s:script_path.'/initialize.py'
|
execute 'pyfile '.s:script_path.'/initialize.py'
|
||||||
elseif g:jedi#force_py_version == 3
|
elseif g:jedi#force_py_version == 3
|
||||||
command! -nargs=1 Python python3 <args>
|
command! -nargs=1 PythonJedi python3 <args>
|
||||||
execute 'py3file '.s:script_path.'/initialize.py'
|
execute 'py3file '.s:script_path.'/initialize.py'
|
||||||
endif
|
endif
|
||||||
catch
|
catch
|
||||||
@@ -371,10 +371,10 @@ else
|
|||||||
if g:jedi#force_py_version == 'auto'
|
if g:jedi#force_py_version == 'auto'
|
||||||
" If it's still "auto", it wasn't handled above.
|
" If it's still "auto", it wasn't handled above.
|
||||||
if has('python')
|
if has('python')
|
||||||
command! -nargs=1 Python python <args>
|
command! -nargs=1 PythonJedi python <args>
|
||||||
execute 'pyfile '.s:script_path.'/initialize.py'
|
execute 'pyfile '.s:script_path.'/initialize.py'
|
||||||
elseif has('python3')
|
elseif has('python3')
|
||||||
command! -nargs=1 Python python3 <args>
|
command! -nargs=1 PythonJedi python3 <args>
|
||||||
execute 'py3file '.s:script_path.'/initialize.py'
|
execute 'py3file '.s:script_path.'/initialize.py'
|
||||||
else
|
else
|
||||||
if !exists("g:jedi#squelch_py_warning")
|
if !exists("g:jedi#squelch_py_warning")
|
||||||
@@ -385,7 +385,7 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
"Python jedi_vim.jedi.set_debug_function(jedi_vim.print_to_stdout, speed=True, warnings=False, notices=False)
|
"PythonJedi jedi_vim.jedi.set_debug_function(jedi_vim.print_to_stdout, speed=True, warnings=False, notices=False)
|
||||||
"Python jedi_vim.jedi.set_debug_function(jedi_vim.print_to_stdout)
|
"PythonJedi jedi_vim.jedi.set_debug_function(jedi_vim.print_to_stdout)
|
||||||
|
|
||||||
" vim: set et ts=4:
|
" vim: set et ts=4:
|
||||||
|
|||||||
Reference in New Issue
Block a user