Last active
September 13, 2019 01:42
-
-
Save zwhitchcox/66744509ba5ed11c50760b8d5c303e48 to your computer and use it in GitHub Desktop.
Bash Script to Install Vim With Python Support
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PY2_CONFIG_DIR=$(sudo find /usr/lib -type d -regex ".*python2.[0-9]/config[^/]*") | |
PY3_CONFIG_DIR=$(sudo find /usr/lib -type d -regex ".*python3.[0-9]/config[^/]*") | |
if ( [ -d "$PY2_CONFIG_DIR" ] || [ -d "$PY3_CONFIG_DIR" ] ) ; then | |
py2_arg="--with-python-config-dir=$PY2_CONFIG_DIR" | |
py3_arg="--with-python3-config-dir=$PY3_CONFIG_DIR" | |
fi | |
if ( [ ! -x "$(command -v vim)" ] || ! (( $( vim --version | grep -c "+python3") )) ); then | |
# have to build from source for YouCompleteMe to work | |
VIM_DIR=$HOME/build/src/vim | |
mkdir -p $VIM_DIR | |
git clone https://github.com/vim/vim --depth=1 $VIM_DIR | |
cd $VIM_DIR | |
sudo ./configure \ | |
--enable-multibyte \ | |
--enable-fontset \ | |
--enable-xim \ | |
--enable-gui=auto \ | |
--enable-luainterp=yes \ | |
--enable-pythoninterp=yes \ | |
--enable-rubyinterp=yes \ | |
--enable-perlinterp \ | |
--enable-cscope \ | |
--enable-sniff \ | |
--with-x \ | |
--with-compiledby=erocpil \ | |
--with-features=huge \ | |
"$py2_arg" \ | |
"$py3_arg" \ | |
--enable-localmap \ | |
--enable-python3interp=yes \ | |
--enable-gtk-check \ | |
--enable-gui=gtk2 \ | |
--prefix=/usr/local | |
make -j8 | |
sudo make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why do you use
sudo
to run./configure
? It should not be needed.