반응형

Updates: November 5, 2024
Contents: Steps to install the latest version of Vim from source (version 9.1)

This guide includes additional configurations considering future plugin setups. 

It assumes that Vim is already installed on your system.

 

Remove Existing Vim Installation
Before installing the latest version, remove any existing Vim installations:

sudo apt-get remove --purge vim vim-runtime vim-tiny vim-gtk vim-gtk3 vim-gnome vim-nox vim-common

 

Set Up Environment for Vim Installation

Update your package list and install necessary packages:

sudo apt update
sudo apt install git make clang libtool-bin libxt-dev libpython3-dev valgrind -y

 

Configure Vim Dependencies

Enable source repositories and install build dependencies:

(from https://mebadong.tistory.com/92)

sudo cp /etc/apt/sources.list /etc/apt/sources.list~
sudo sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list
sudo apt-get update
sudo apt-get build-dep vim

 

Clone Vim Source Code

Download the Vim source code from the official repository:

git clone https://github.com/vim/vim.git
cd vim/src

 

Clean Previous Build Configurations

If you've previously built Vim, clean the build environment:

sudo make distclean

 

Configure Vim Build Options

Set up the build configuration with Python3 support:

./configure --with-features=huge \
            --enable-multibyte \
            --enable-python3interp=yes \
            --with-python3-config-dir=$(python3-config --configdir) \
            --prefix=/usr/local

 

Compile and Install Vim

Build and install Vim:

sudo make
sudo make install

 

Create Symbolic Link for 'vi' Command

To allow the 'vi' command to invoke Vim:

sudo ln -s /usr/local/bin/vim /usr/local/bin/vi

 

References

반응형

+ Recent posts