Last active
September 8, 2022 06:09
-
-
Save romainl/4e0f008824a29f47329ee14e96eba411 to your computer and use it in GitHub Desktop.
One way to set up MacVim for Python and Python 3 on MacOS (assuming Python and Python 3 were installed through MacPorts)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if toupper(substitute(system('uname'), '\n', '', '')) =~ 'DARWIN' | |
\ && exists('+pythonhome') | |
\ && exists('+pythondll') | |
\ && exists('+pythonthreehome') | |
\ && exists('+pythonthreedll') | |
let python_path = '/opt/local/Library/Frameworks/Python.framework/Versions' | |
let &pythonhome = '' | |
let &pythondll = '' | |
let &pythonthreehome = '' | |
let &pythonthreedll = '' | |
for i in range(0, 11) | |
if filereadable(python_path . '/2.' . i . '/lib/libpython2.' . i . '.dylib') | |
\ && &pythonhome == '' | |
\ && &pythondll == '' | |
let &pythonhome = python_path . '/2.' . i | |
let &pythondll = python_path . '/2.' . i . '/lib/libpython2.' . i . '.dylib' | |
endif | |
if filereadable(python_path . '/3.' . i . '/lib/libpython3.' . i . '.dylib') | |
\ && &pythonthreehome == '' | |
\ && &pythonthreedll == '' | |
let &pythonthreehome = python_path . '/3.' . i | |
let &pythonthreedll = python_path . '/3.' . i . '/lib/libpython3.' . i . '.dylib' | |
endif | |
endfor | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment