Skip to content Skip to sidebar Skip to footer

Install Vim Via Homebrew With Python And Python3 Support

I would like to enable Python auto-completion in Vim so maybe this is a non-issue. This is what I've observed: First, Virtual Environments provides the ability to assign an interpr

Solution 1:

Vim compiled with both, or with 'dynamic' is only available on Windows versions. Mac/*nix/etc can only use one version of Python.

My way around this was to compile two different vims, one with each Python version, and then create a version check in my .vimrc to be co-compatible with the two of them.

if has('python')
  let g:jedi#force_py_version = 2let g:syntastic_python_python_exec = 'python2'let g:pymode_python = 'python2'
elseif has('python3')
  let g:jedi#force_py_version = 3let g:syntastic_python_python_exec = 'python3'let g:pymode_python = 'python3'elselet g:loaded_jedi = 1
endif

Modifying this with whatever python-specific plugins or function you have installed, of course.

Post a Comment for "Install Vim Via Homebrew With Python And Python3 Support"