DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Yao-Ching Huang
Yao-Ching Huang

Posted on • Updated on

Compiling Vim with Python3 support

Prerequisites

  • Python3
  • make
  • libtool

Confirm the Python path and version

$ which python3
/Users/tom/.pyenv/shims/python3

$ python3 -V
Python 3.10.6
Enter fullscreen mode Exit fullscreen mode

Compile Vim with Python3 support

git clone https://github.com/vim/vim.git
cd vim/src
./configure --enable-python3interp
make
sudo make install
Enter fullscreen mode Exit fullscreen mode

Validation

Running :py3 import sys;print(sys.version); in Vim will show the linked Python version.

3.10.6 (main, Aug  8 2022, 15:10:42) [Clang 13.1.6 (clang-1316.0.21.2.5)]
Enter fullscreen mode Exit fullscreen mode

See also

https://github.com/vim/vim/blob/master/src/INSTALL

https://github.com/vim/vim/blob/master/src/Makefile

Top comments (0)

🌚 Browsing with dark mode makes you a better developer by a factor of exactly 40.

It's a scientific fact.