@@ -10,34 +10,43 @@ set nocompatible
1010set backspace += indent ,eol ,start
1111
1212" Python2
13- " MacVim is configured by default to use the pre-installed System python2
14- " version. However, following code tries to find a Homebrew, MacPorts or
15- " an installation from python.org:
13+ " MacVim is configured by default in the binary release to use the
14+ " pre-installed System python2 version. However, following code tries to
15+ " find a Homebrew, MacPorts or an installation from python.org:
1616if exists (" &pythondll" ) && exists (" &pythonhome" )
17+ " Homebrew python 2.7
1718 if filereadable (" /usr/local/Frameworks/Python.framework/Versions/2.7/Python" )
18- " Homebrew python 2.7
1919 set pythondll = /usr/ local/Frameworks/ Python.framework/Versions/ 2.7 /Python
20+
21+ " MacPorts python 2.7
2022 elseif filereadable (" /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python" )
21- " MacPorts python 2.7
2223 set pythondll = /opt/ local/Library/ Frameworks/Python.framework/ Versions/2.7/ Python
24+
25+ " https://www.python.org/downloads/mac-osx/
2326 elseif filereadable (" /Library/Frameworks/Python.framework/Versions/2.7/Python" )
24- " https://www.python.org/downloads/mac-osx/
2527 set pythondll = /Library/ Frameworks/Python.framework/ Versions/2.7/ Python
2628 endif
2729endif
2830
2931" Python3
30- " MacVim is configured by default to use Homebrew python3 version
31- " If this cannot be found, following code tries to find a MacPorts
32- " or an installation from python.org:
32+ " MacVim is configured by default in the binary release to set
33+ " pythonthreedll to Homebrew python3. If it cannot be found, the following
34+ " code tries to find Python3 from other popular locations. Note that we are
35+ " using "Current" for the version, because Vim supports the stable ABI and
36+ " therefore any new version of Python3 will work.
3337if exists (" &pythonthreedll" ) && exists (" &pythonthreehome" ) &&
3438 \ ! filereadable (&pythonthreedll )
35- if filereadable (" /opt/local/Library/Frameworks/Python.framework/Versions/3.11/Python" )
36- " MacPorts python
37- set pythonthreedll = /opt/ local/Library/ Frameworks/Python.framework/ Versions/3.11/ Python
38- elseif filereadable (" /Library/Frameworks/Python.framework/Versions/3.11/Python" )
39- " https://www.python.org/downloads/mac-osx/
40- set pythonthreedll = /Library/ Frameworks/Python.framework/ Versions/3.11/ Python
39+ " MacPorts python
40+ if filereadable (" /opt/local/Library/Frameworks/Python.framework/Versions/Current/Python" )
41+ set pythonthreedll = /opt/ local/Library/ Frameworks/Python.framework/ Versions/Current/ Python
42+
43+ " macOS default Python, installed by 'xcode-select --install'
44+ elseif filereadable (" /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/Current/Python3" )
45+ set pythonthreedll = /Library/ Developer/CommandLineTools/ Library/Frameworks/ Python3.framework/Versions/ Current/Python3
46+
47+ " https://www.python.org/downloads/mac-osx/
48+ elseif filereadable (" /Library/Frameworks/Python.framework/Versions/Current/Python" )
49+ set pythonthreedll = /Library/ Frameworks/Python.framework/ Versions/Current/ Python
4150 endif
4251endif
4352
0 commit comments