2015-10-28 17:54:46 +00:00
|
|
|
#! /bin/bash
|
|
|
|
|
2012-07-02 19:26:56 +00:00
|
|
|
############################
|
|
|
|
# Vim Settings Setup script by ViViDboarder (Ian)
|
|
|
|
# http://github.com/ViViDboarder/Vim-Settings
|
|
|
|
############################
|
2012-03-29 03:18:33 +00:00
|
|
|
|
2015-10-28 17:50:01 +00:00
|
|
|
if [ -d ~/.vim ] || [ -f ~/.vimrc ] || [ -d ~/.nvim ] || [ -f ~/.nvimrc ] || [ -d ~/.config/nvim ]; then
|
|
|
|
echo "Vim files already exist. Please backup or remove .(n)vim and .(n)vimrc and .config/nvim"
|
2015-03-26 17:09:26 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2012-03-29 03:18:33 +00:00
|
|
|
# Get current directory for future use in links
|
2012-10-23 14:52:47 +00:00
|
|
|
VIM_SYNC_DIR=$(dirname $0)
|
|
|
|
cd $VIM_SYNC_DIR
|
|
|
|
VIM_SYNC_DIR=$(pwd)
|
2012-03-29 03:18:33 +00:00
|
|
|
|
|
|
|
|
2015-03-27 00:45:03 +00:00
|
|
|
# Vim
|
2015-10-28 17:50:01 +00:00
|
|
|
ln -s $VIM_SYNC_DIR/vim/init.vim ~/.vimrc
|
2015-03-26 17:09:26 +00:00
|
|
|
ln -s $VIM_SYNC_DIR/vim ~/.vim
|
2012-03-29 03:18:33 +00:00
|
|
|
|
2015-10-28 05:56:35 +00:00
|
|
|
# Neovim legacy
|
2015-10-28 17:50:01 +00:00
|
|
|
ln -s $VIM_SYNC_DIR/vim/init.vim ~/.nvimrc
|
2015-03-27 00:45:03 +00:00
|
|
|
ln -s $VIM_SYNC_DIR/vim ~/.nvim
|
|
|
|
|
2015-10-28 05:56:35 +00:00
|
|
|
# Neovim new
|
|
|
|
mkdir -p ${XDG_CONFIG_HOME:=$HOME/.config}
|
|
|
|
ln -s $VIM_SYNC_DIR/vim $XDG_CONFIG_HOME/nvim
|
|
|
|
|
2012-07-02 17:25:36 +00:00
|
|
|
# Install all bundles
|
2012-07-03 14:13:15 +00:00
|
|
|
echo "Install all bundles"
|
2015-03-26 17:09:26 +00:00
|
|
|
vim +PlugInstall +qall
|
2015-06-03 21:28:44 +00:00
|
|
|
if hash nvim 2>/dev/null; then
|
|
|
|
nvim +PlugInstall +qall
|
2015-09-29 16:27:05 +00:00
|
|
|
nvim +UpdateRemotePlugins +qall
|
2015-06-03 21:28:44 +00:00
|
|
|
fi
|
2012-03-29 03:18:33 +00:00
|
|
|
|
2015-09-29 16:27:05 +00:00
|
|
|
vim --version | grep -q '\+lua' || { echo "Warning: Default vim does not include lua"; }
|
2015-03-26 17:09:26 +00:00
|
|
|
vim --version | grep -q '\+ruby' || { echo "Warning: Default vim does not include ruby."; }
|
|
|
|
vim --version | grep -q '\+python' || { echo "Warning: Default vim does not include python"; }
|
2013-04-16 22:40:49 +00:00
|
|
|
|
2015-09-29 16:27:05 +00:00
|
|
|
echo "If using Neovim, install the python modules"
|
|
|
|
|
2013-01-06 02:40:56 +00:00
|
|
|
echo "All done!"
|
|
|
|
exit 0
|
|
|
|
|