From e3300e06bd9cb0c5125b772819fb26337a257f89 Mon Sep 17 00:00:00 2001 From: Arseny Nasokin <485399+eirnym@users.noreply.github.com> Date: Sun, 26 Aug 2018 13:44:41 +0200 Subject: [PATCH 1/3] Use Python 3.7 from python.org if installed --- src/MacVim/vimrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/MacVim/vimrc b/src/MacVim/vimrc index 80fd7edf1b..f14ea507d5 100644 --- a/src/MacVim/vimrc +++ b/src/MacVim/vimrc @@ -28,10 +28,10 @@ endif " MacVim uses Homebrew python3 if installed, next try to use python.org binary if exists("&pythonthreedll") && exists("&pythonthreehome") && \ !filereadable(&pythonthreedll) - if filereadable("/Library/Frameworks/Python.framework/Versions/3.6/Python") + if filereadable("/Library/Frameworks/Python.framework/Versions/3.7/Python") " https://www.python.org/downloads/mac-osx/ - set pythonthreedll=/Library/Frameworks/Python.framework/Versions/3.6/Python - set pythonthreehome=/Library/Frameworks/Python.framework/Versions/3.6 + set pythonthreedll=/Library/Frameworks/Python.framework/Versions/3.7/Python + set pythonthreehome=/Library/Frameworks/Python.framework/Versions/3.7 endif endif From 4c88b29ced6b45a3d28aebd8103cb9cb0f09b424 Mon Sep 17 00:00:00 2001 From: Arseny Nasokin <485399+eirnym@users.noreply.github.com> Date: Sun, 26 Aug 2018 13:45:59 +0200 Subject: [PATCH 2/3] Use Python from MacPorts after Homebrew if installed --- src/MacVim/vimrc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/MacVim/vimrc b/src/MacVim/vimrc index f14ea507d5..86c992f241 100644 --- a/src/MacVim/vimrc +++ b/src/MacVim/vimrc @@ -17,10 +17,14 @@ set langmenu=none " Python2 " MacVim uses Homebrew python2 if installed, otherwise configured one if exists("&pythondll") && exists("&pythonhome") - if filereadable("/usr/local/Frameworks/Python.framework/Versions/2.7/Python") + if filereadable("/usr/local/Library/Frameworks/Python.framework/Versions/2.7/Python") " Homebrew python 2.7 set pythondll=/usr/local/Frameworks/Python.framework/Versions/2.7/Python set pythonhome=/usr/local/Frameworks/Python.framework/Versions/2.7 + elseif filereadable("/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python") + " MacPorts python 2.7 + set pythondll=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python + set pythonhome=/opt/local/Library/Frameworks/Python.framework/Versions/2.7 endif endif @@ -28,7 +32,11 @@ endif " MacVim uses Homebrew python3 if installed, next try to use python.org binary if exists("&pythonthreedll") && exists("&pythonthreehome") && \ !filereadable(&pythonthreedll) - if filereadable("/Library/Frameworks/Python.framework/Versions/3.7/Python") + if filereadable("/opt/local/Library/Frameworks/Python.framework/Versions/3.7/Python") + " MacPorts python 3.7 + set pythonthreedll=/opt/local/Library/Frameworks/Python.framework/Versions/3.7/Python + set pythonthreehome=/opt/local/Library/Frameworks/Python.framework/Versions/3.7 + elseif filereadable("/Library/Frameworks/Python.framework/Versions/3.7/Python") " https://www.python.org/downloads/mac-osx/ set pythonthreedll=/Library/Frameworks/Python.framework/Versions/3.7/Python set pythonthreehome=/Library/Frameworks/Python.framework/Versions/3.7 From 3c6e0b05c02bebf7e22709466fb1d6e3582e328d Mon Sep 17 00:00:00 2001 From: Arseny Nasokin Date: Tue, 28 Aug 2018 09:41:50 +0200 Subject: [PATCH 3/3] Added requested comments and Python2.7 from python.org detection --- src/MacVim/vimrc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/MacVim/vimrc b/src/MacVim/vimrc index 86c992f241..2e4e66994b 100644 --- a/src/MacVim/vimrc +++ b/src/MacVim/vimrc @@ -15,7 +15,9 @@ set backspace+=indent,eol,start set langmenu=none " Python2 -" MacVim uses Homebrew python2 if installed, otherwise configured one +" MacVim is configured by default to use the pre-installed System python2 +" version. However, following code tries to find a Homebrew, MacPorts or +" an installation from python.org: if exists("&pythondll") && exists("&pythonhome") if filereadable("/usr/local/Library/Frameworks/Python.framework/Versions/2.7/Python") " Homebrew python 2.7 @@ -25,11 +27,17 @@ if exists("&pythondll") && exists("&pythonhome") " MacPorts python 2.7 set pythondll=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python set pythonhome=/opt/local/Library/Frameworks/Python.framework/Versions/2.7 + elseif filereadable("/Library/Frameworks/Python.framework/Versions/2.7/Python") + " https://www.python.org/downloads/mac-osx/ + set pythonthreedll=/Library/Frameworks/Python.framework/Versions/2.7/Python + set pythonthreehome=/Library/Frameworks/Python.framework/Versions/2.7 endif endif " Python3 -" MacVim uses Homebrew python3 if installed, next try to use python.org binary +" MacVim is configured by default to use Homebrew python3 version +" If this cannot be found, following code tries to find a MacPorts +" or an installation from python.org: if exists("&pythonthreedll") && exists("&pythonthreehome") && \ !filereadable(&pythonthreedll) if filereadable("/opt/local/Library/Frameworks/Python.framework/Versions/3.7/Python")