-
-
Save alan/346887 to your computer and use it in GitHub Desktop.
This file contains 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 | |
DOTVIM="/Users/`whoami`/.vim" | |
JQUERY=12107 | |
if [ ! -e `which git` ] | |
then | |
echo "You need git. Try running install_git" | |
exit 0 | |
fi | |
if [ ! -d $DOTVIM ] | |
then | |
mkdir $DOTVIM | |
fi | |
get_repo() { | |
gh_user=$1 | |
repo=$2 | |
echo "Checking $repo" | |
if [ -d "$DOTVIM/bundle/$repo/" ] | |
then | |
echo "Pulling latest from $repo" | |
cd $DOTVIM/bundle/$repo | |
git pull origin master | |
cd .. | |
else | |
echo "Cloning repo for $repo" | |
cd $DOTVIM/bundle | |
git clone git://github.com/$gh_user/$repo.git | |
fi | |
} | |
echo "Creating .vim folders if necessary" | |
cd $DOTVIM/bundle/ | |
mkdir -p $DOTVIM/{autoload,bundle} | |
tpope_repos=(rails haml git cucumber markdown) | |
for r in ${tpope_repos[*]}; do | |
repo="vim-$r" | |
get_repo "tpope" $repo | |
done | |
echo "Installing NERDTree" | |
get_repo "scrooloose" "nerdtree" | |
echo "Installing NERDCommenter" | |
get_repo "scrooloose" "nerdcommenter" | |
echo "Installing snipMate" | |
get_repo "msanders" "snipmate.vim" | |
echo "Installing vim-ruby" | |
get_repo "vim-ruby" "vim-ruby" | |
echo "Installing mustache.vim" | |
get_repo "jc00ke" "mustache.vim" | |
echo "Installing jQuery" | |
mkdir -p jquery/syntax | |
wget -c -O jquery/syntax/jquery.vim http://www.vim.org/scripts/download_script.php?src_id=$JQUERY | |
cd $DOTVIM/autoload | |
echo "Fetching latest pathogen.vim" | |
rm pathogen.vim | |
wget http://github.com/tpope/vim-pathogen/raw/master/autoload/pathogen.vim | |
echo "Checking to see if pathogen has already been added to .vimrc" | |
pathogen_cmd="call pathogen#runtime_append_all_bundles()" | |
contains=`grep "$pathogen_cmd" ~/.vimrc | wc -l` | |
if [ $contains == 0 ] | |
then | |
echo "Hasn't been added, adding now." | |
echo "$pathogen_cmd" >> ~/.vimrc | |
else | |
echo "It was already added. Good to go" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment