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
'Setting > Terminal (Shell)' 카테고리의 다른 글
[NVim] How to Install vim-plug (Linux, Ubuntu) (2) | 2024.11.06 |
---|---|
[NVim] How to Install the Latest Version (Ubuntu) (4) | 2024.11.06 |
[Vim] 최신 버전 설치 방법 (Ubuntu, Kor) (0) | 2024.11.05 |
[Terminal] 항상 관리자 권한으로 여는 방법 (Windows) (0) | 2024.09.09 |
Vim tutorial (0) | 2024.07.08 |