" Add the virtualenv's site-packages to vim path if has('python') py << EOF import os.path import sys import vim if 'VIRTUAL_ENV' in os.environ: project_base_dir = os.environ['VIRTUAL_ENV'] version = sys.version_info sys.path.insert(0, os.path.join(project_base_dir, 'lib', 'python{}.{}'.format(version.major, version.minor), 'site-packages')) EOF endif