Vim 8.2 source code compilation and installation add Python3 extension

introduce

In order to install plugins like YouCompleteMe, you need to upgrade Vim to a higher version and enable the Python3 extension. Therefore, what is provided here is a record of the process of installing the latest version of Vim through source code.

The Vim source code repository address used here:https://github.com/vim/vim/

Compile and install the default version

Before compiling and installing, you must install related tools and dependencies

% sudo apt install git make clang libpython3-dev

Select the appropriate directory to execute the clone command

% git clone https://github.com/vim/vim.git

After the clone is successful, the vim directory will appear, and enter the src directory under this directory.

% cd vim/src

Execute the compilation (for speed, you can replace the execution% make -j4to compile in parallel)

% make

execute the test

% make test

Installed to /usr/local by default

% sudo make install

Enable Python3 extension support

After the above operations are completed, open the Makefile in this directory and find"CONF_OPT_PYTHON3 = --enable-python3interp"and uncomment the line, save.

Execute the command to update the compilation parametersmake reconfig

 

 

 

zh_CNZH-CN