forked from harlanhaskins/harlan-vimrc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup_vimrc.sh
executable file
·37 lines (30 loc) · 870 Bytes
/
setup_vimrc.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# Move to directory of script
OLDDIR=`pwd`
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR
# Backup old vimrc files
if [ -f ~/.vimrc ]; then
mv ~/.vimrc ~/.vimrc.old
fi;
if [ -f ~/.vimrc_bundles ]; then
mv ~/.vimrc_bundles ~/.vimrc_bundles.old
fi;
if [ -f ~/.vimrc_vundle ]; then
mv ~/.vimrc_vundle ~/.vimrc_vundle.old
fi;
# Create hardlinks between local vimrc files and the actual vimrc files
ln -F .vimrc ~/
ln -F .vimrc_vundle ~/
ln -F .vimrc_bundles ~/
# Install Vundle (https://github.com/gmarik/vundle)
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
# Install YouCompleteMe, if applicable
VIM_VERSION=`vim --version | grep 7.4`
if [[$VIM_VERSION != ""]]; then
echo "Bundle 'Valloric/YouCompleteMe'" >> .vimrc_bundles
fi
# Clean/install bundles
vim -u .vimrc_setup
# Return to original dir
cd $OLDDIR