vim-settings/vim-sync-append.sh

49 lines
1.2 KiB
Bash
Raw Normal View History

############################
# Vim Settings Setup script by ViViDboarder (Ian)
# http://github.com/ViViDboarder/Vim-Settings
############################
2012-03-29 03:18:33 +00:00
#! /bin/bash
2015-03-27 00:45:03 +00:00
if [ -d ~/.vim ] || [ -f ~/.vimrc ] || [ -d ~/.nvim ] || [ -f ~/.nvimrc ]; then
echo "Vim files already exist. Please backup or remove .(n)vim and .(n)vimrc"
2015-03-26 17:09:26 +00:00
exit 1
fi
# Try to load .bashrc to load rvm functions
2015-03-27 00:45:03 +00:00
# if [ -f ~/.bashrc ]; then
# . ~/.bashrc
# fi
2012-03-29 03:18:33 +00:00
# Get current directory for future use in links
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-03-26 17:09:26 +00:00
ln -s $VIM_SYNC_DIR/vimrc ~/.vimrc
ln -s $VIM_SYNC_DIR/vim ~/.vim
2012-03-29 03:18:33 +00:00
# Neovim legacy
2015-03-27 00:45:03 +00:00
ln -s $VIM_SYNC_DIR/vimrc ~/.nvimrc
ln -s $VIM_SYNC_DIR/vim ~/.nvim
# Neovim new
mkdir -p ${XDG_CONFIG_HOME:=$HOME/.config}
ln -s $VIM_SYNC_DIR/vimrc $XDG_CONFIG_HOME/nvim/init.vim
ln -s $VIM_SYNC_DIR/vim $XDG_CONFIG_HOME/nvim
2012-07-02 17:25:36 +00:00
# Install all bundles
echo "Install all bundles"
2015-03-26 17:09:26 +00:00
vim +PlugInstall +qall
if hash nvim 2>/dev/null; then
nvim +PlugInstall +qall
fi
2012-03-29 03:18:33 +00:00
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"; }
echo "All done!"
exit 0