by Devin Yang
(This article was automatically translated.)

Published - 6 years ago ( Updated - 6 years ago )

foreword

If you use Vim preset for the Mac system, will there be an error that python2.7 or python3 is required when executing the terminal, but the system obviously has python 2.7? This article explains how I can fix this problem.
vim

my way

As far as I know, this problem can be solved by installing compiled vim through homebrew, but it is not difficult to compile Vim on MacOs, so I compiled it myself.
To have gcc commands on MacOs, you need to install Xcode.

step:
1. Install the latest official version of python3
https://www.python.org/

2. Download vim official source
git clone https://github.com/vim/vim
3. Enter the folder of cd vim and execute the configuration

Fourth, it is best to perform a make distclean

5. Configuration
./configure –enable-multibyte \
--enable-fontset \
--enable-python3interp=yes
If there is no error related to --with-tlib, it means that the ncurses library is missing. We can install it with the following command:
sudo apt-get install libncurses5-dev libncursesw5-dev
Or on ubuntu 16.0.4, available
sudo apt-get install ncurses-dev

Six, make

7. sudo make install
You can install the self-compiled vim to the /usr/local/bin/vim directory.

7. Set the alias of vim='/usr/local/bin/vim' to .bash_profile or .zshrc by yourself, please decide according to your own environment.

It is normal to execute vim again.
 

Tags: vim macos

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


vim

About vimdiff

My vimdiff cheat sheet

Emoji, MacOS

⌘+control+blank (Emoji on Mac)

⌘+control+blank (Emoji on Mac)

config,vim

Chinese environment of Vim on Ubuntu

If Vim is set to Chinese environment, but Ubuntu is not set to zh_TW.UTF-8 during installation, how to install this environment?