mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-10 04:21:52 +08:00
renamed Pyedit to Pyimport, refs #117
This commit is contained in:
@@ -53,7 +53,7 @@ if g:jedi#auto_initialization
|
|||||||
autocmd FileType Python setlocal omnifunc=jedi#complete switchbuf=useopen " needed for pydoc
|
autocmd FileType Python setlocal omnifunc=jedi#complete switchbuf=useopen " needed for pydoc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
fun! Pyedit(cmd, args)
|
fun! Pyimport(cmd, args)
|
||||||
py << EOF
|
py << EOF
|
||||||
# args are the same as for the :edit command
|
# args are the same as for the :edit command
|
||||||
# cmd: one of edit, split, vsplit, tabedit, ...
|
# cmd: one of edit, split, vsplit, tabedit, ...
|
||||||
@@ -77,7 +77,7 @@ if 1:
|
|||||||
EOF
|
EOF
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
fun! Pyedit_comp(argl, cmdl, pos)
|
fun! Pyimport_comp(argl, cmdl, pos)
|
||||||
py << EOF
|
py << EOF
|
||||||
if 1:
|
if 1:
|
||||||
import vim
|
import vim
|
||||||
@@ -87,7 +87,7 @@ if 1:
|
|||||||
try:
|
try:
|
||||||
import jedi
|
import jedi
|
||||||
except ImportError as err:
|
except ImportError as err:
|
||||||
print('Pyedit completion requires jedi module: https://github.com/davidhalter/jedi')
|
print('Pyimport completion requires jedi module: https://github.com/davidhalter/jedi')
|
||||||
comps = []
|
comps = []
|
||||||
else:
|
else:
|
||||||
text = 'import %s' % argl
|
text = 'import %s' % argl
|
||||||
@@ -98,8 +98,8 @@ EOF
|
|||||||
return comps
|
return comps
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
command! -nargs=1 -complete=custom,Pyedit_comp Pyedit :call Pyedit('edit', <q-args>)
|
command! -nargs=1 -complete=custom,Pyimport_comp Pyimport :call Pyimport('edit', <q-args>)
|
||||||
" command! -nargs=1 -complete=custom,Pyedit_comp Pysplit :call Pyedit('split', <q-args>)
|
" command! -nargs=1 -complete=custom,Pyimport_comp Pysplit :call Pyimport('split', <q-args>)
|
||||||
" command! -nargs=1 -complete=custom,Pyedit_comp Pyvsplit :call Pyedit('vsplit', <q-args>)
|
" command! -nargs=1 -complete=custom,Pyimport_comp Pyvsplit :call Pyimport('vsplit', <q-args>)
|
||||||
" command! -nargs=1 -complete=custom,Pyedit_comp Pytabe :call Pyedit('tabe', <q-args>)
|
" command! -nargs=1 -complete=custom,Pyimport_comp Pytabe :call Pyimport('tabe', <q-args>)
|
||||||
" vim: set et ts=4:
|
" vim: set et ts=4:
|
||||||
|
|||||||
Reference in New Issue
Block a user