I am frequently using vim features that are not built into the default distro builds, and so I find it easiest to just build and install it from scratch to get exactly what I need.
This script accomplishes exactly that:
# Clean from standard vim
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt autoremove
# Vim dependency
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python3-dev libperl-dev libncurses5-dev ruby-dev
# if you want console vim to have X-clipboard functionality
# I use this on debian WSL to execute a terminator process connected to VcXsrv on windows
# https://stackoverflow.com/questions/11416069/compile-vim-with-clipboard-and-xterm
sudo apt install libx11-dev libxtst-dev libxt-dev libsm-dev libxpm-dev
# if you want gVim add also this
#sudo apt-get install libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
# Clean and prepare folders
sudo rm -rf /usr/local/share/vim
sudo rm /usr/bin/vim
sudo mkdir /usr/include/lua5.1/include
# Download it and compile
git clone https://github.com/vim/vim
cd vim/src
make distclean
./configure --with-features=huge \
--enable-rubyinterp \
--with-ruby-command=$(which ruby) \
--enable-largefile \
--disable-netbeans \
--enable-python3interp \
--with-python3-config-dir=$(python3-config --configdir)
--enable-perlinterp \
--enable-luainterp \
--with-luajit \
--enable-gui=auto \
--enable-fail-if-missing \
--with-lua-prefix=/usr/include/lua5.1 \
--enable-cscope
make
sudo make install
installvim.sh 📷: https://www.reddit.com/r/vim/comments/aqvmvr/new_vim_logo_suggestion