Skip to content

Instantly share code, notes, and snippets.

@zer0beat
Last active March 2, 2022 03:13
Show Gist options
  • Save zer0beat/2f3aa1e81d9bedb0355a46e59ffcea34 to your computer and use it in GitHub Desktop.
Save zer0beat/2f3aa1e81d9bedb0355a46e59ffcea34 to your computer and use it in GitHub Desktop.
Install vim from source on Bash for Windows (WSL)
#!/bin/bash
# Download and install command
# wget -qO- https://gist.github.com/zer0beat/2f3aa1e81d9bedb0355a46e59ffcea34/raw | VIM_VERSION=8.0.1111 bash
VIM_VERSION=${VIM_VERSION:-"8.0.1111"}
VIM_SOURCE_CODE=https://github.com/vim/vim/archive/v${VIM_VERSION}.tar.gz
WORKDIR=~/vim-install
# Install dependencies
sudo apt-get update
sudo apt-get install -y build-essential libncurses5-dev python-dev \
python3-dev ruby-dev lua5.1 liblua5.1-dev libperl-dev
# Download tmux
mkdir -p ${WORKDIR}/vim
wget -qO- ${VIM_SOURCE_CODE} | tar xz --strip-components=1 -C ${WORKDIR}/vim
# Install tmux
pushd .
cd ${WORKDIR}/vim
./configure --with-features=huge \
--enable-multibyte \
--enable-rubyinterp=yes \
--enable-python3interp=yes \
--with-python3-config-dir=/usr/lib/python3.5/config \
--enable-perlinterp=yes \
--enable-luainterp=yes \
--enable-gui \
--enable-cscope \
--prefix=/usr/local
make VIMRUNTIMEDIR=/usr/local/share/vim/vim80
sudo make install
sudo update-alternatives --install /usr/bin/editor editor /usr/bin/vim 1
sudo update-alternatives --set editor /usr/bin/vim
sudo update-alternatives --install /usr/bin/vi vi /usr/bin/vim 1
sudo update-alternatives --set vi /usr/bin/vim
popd
# Clean all
rm -rf ${WORKDIR}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment