Files
jedi-vim/initialize.py
Asa Jay 3ad63c9458 Implemented: force python 2 or 3 with ability to switch during runtime
Simultaneous python2 and python3 support, switchable during runtime
calling a function as well as setting a variable in .vimrc! Closes
issues #200 and #210 (which gave the idea for this commit, thank you
@Shtucer).
2013-12-13 20:51:24 +01:00

26 lines
722 B
Python

''' ------------------------------------------------------------------------
Python initialization
---------------------------------------------------------------------------
here we initialize the jedi stuff '''
import vim
# update the system path, to include the jedi path
import sys
import os
# vim.command('echom expand("<sfile>:p:h:h")')
sys.path.insert(0, os.path.join(vim.eval('expand("<sfile>:p:h:h")'), 'jedi'))
# to display errors correctly
import traceback
# update the sys path to include the jedi_vim script
sys.path.insert(1, vim.eval('expand("<sfile>:p:h:h")'))
try:
import jedi_vim
except ImportError:
vim.command('echoerr "Please install Jedi if you want to use jedi_vim."')
sys.path.pop(1)