2013-03-22 18:06:04 -07:00
|
|
|
#!/usr/bin/env zsh
|
2013-03-16 21:16:00 -07:00
|
|
|
|
2013-03-22 10:15:50 -07:00
|
|
|
# Installing macvim/compiling vim
|
|
|
|
if is_mac && ! command_exists "mvim"; then
|
2013-10-21 01:18:16 -07:00
|
|
|
|
2013-10-18 04:03:28 -07:00
|
|
|
echo_g "==> Installing macvim"
|
2013-08-03 08:16:52 -07:00
|
|
|
brew install macvim --devel --with-lua --override-system-vim
|
2013-10-21 01:18:16 -07:00
|
|
|
|
2013-03-23 01:47:55 -07:00
|
|
|
elif is_deb && ! vim --version | grep "Compiled by $(whoami)@$(hostname)" 2>&1 >/dev/null; then
|
2013-10-21 01:18:16 -07:00
|
|
|
|
|
|
|
# All the prereqs to compile vim. Might need to add lua...
|
2013-10-18 04:03:28 -07:00
|
|
|
echo_g "==> Preparing to compile vim from source"
|
|
|
|
pkg_install libncurses5-dev libgnome2-dev libgnomeui-dev \
|
2013-03-22 10:15:50 -07:00
|
|
|
libgtk2.0-dev libatk1.0-dev libbonoboui2-dev \
|
|
|
|
libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev ruby-dev mercurial
|
2013-10-18 04:03:28 -07:00
|
|
|
pkg_remove vim vim-runtime gvim
|
2013-03-16 21:16:00 -07:00
|
|
|
|
2013-10-21 01:18:16 -07:00
|
|
|
# Compile vim from source (needs Vim 7.3.584 *at least*, but we grab the latest 7.4
|
|
|
|
# from the repo for good measure). At the time of writing, Debian still uses 7.2 and
|
|
|
|
# Ubuntu: 7.3.
|
2013-03-22 10:15:50 -07:00
|
|
|
cd ~
|
|
|
|
hg clone https://code.google.com/p/vim/
|
|
|
|
cd vim
|
2013-12-17 19:58:52 -08:00
|
|
|
hg checkout v7-4-131
|
2013-10-21 01:18:16 -07:00
|
|
|
|
2013-10-18 04:03:28 -07:00
|
|
|
echo_g "==> Compiling vim from source"
|
2013-03-22 10:15:50 -07:00
|
|
|
./configure --with-features=huge \
|
|
|
|
--enable-rubyinterp \
|
|
|
|
--enable-pythoninterp \
|
|
|
|
--enable-perlinterp \
|
2013-08-03 08:16:52 -07:00
|
|
|
--enable-luainterp \
|
2013-03-22 10:15:50 -07:00
|
|
|
--enable-gui=gtk2 --enable-cscope --prefix=/usr
|
2013-10-21 01:18:16 -07:00
|
|
|
make VIMRUNTIMEDIR=/usr/share/vim/vim74
|
2013-03-22 10:15:50 -07:00
|
|
|
sudo make install
|
2013-10-21 01:18:16 -07:00
|
|
|
|
2013-03-22 10:15:50 -07:00
|
|
|
rm -rf ~/vim
|
2013-10-21 01:18:16 -07:00
|
|
|
|
2013-03-16 21:28:28 -07:00
|
|
|
fi
|
|
|
|
|
2013-03-22 10:15:50 -07:00
|
|
|
# Installing vim rcfiles
|
2013-10-21 01:18:16 -07:00
|
|
|
if [ ! -e ~/.vim/.git ]; then
|
2013-10-18 04:03:28 -07:00
|
|
|
echo_g "==> Installing vim rcfiles"
|
2013-03-16 21:28:28 -07:00
|
|
|
|
2013-03-22 13:08:02 -07:00
|
|
|
if [ -d ~/.vim ]; then
|
2013-03-16 21:28:28 -07:00
|
|
|
rm -rf ~/.vim
|
2013-03-21 09:33:12 -07:00
|
|
|
rm ~/.vimrc
|
|
|
|
rm ~/.vimrc.bundles
|
|
|
|
rm ~/.gvimrc
|
2013-03-16 21:28:28 -07:00
|
|
|
fi
|
2013-03-23 01:17:34 -07:00
|
|
|
if is_deb; then
|
2013-10-18 04:03:28 -07:00
|
|
|
pkg_install cmake
|
2013-03-23 01:17:34 -07:00
|
|
|
fi
|
2013-03-23 01:49:03 -07:00
|
|
|
|
|
|
|
# Install vim from my distro: https://github.com/hlissner/mlvim
|
2013-12-17 19:58:52 -08:00
|
|
|
git clone https://github.com/hlissner/vim ~/.vim
|
2013-11-30 10:19:21 -08:00
|
|
|
vim -u ~/.vim/.vimrc
|
2013-03-23 01:17:34 -07:00
|
|
|
else
|
|
|
|
# Installing/updating vim bundles
|
2013-11-30 10:19:21 -08:00
|
|
|
echo_r "==> Updating vim"
|
2013-08-03 08:16:52 -07:00
|
|
|
vim +NeoBundleUpdate +qall
|
2013-03-16 21:49:58 -07:00
|
|
|
fi
|
|
|
|
|
2013-10-18 04:03:28 -07:00
|
|
|
echo_g "==> Vim: DONE!"
|