Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added flexibility to get.vimfiles.sh #2

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 31 additions & 12 deletions get.vimfiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
#
# curl https://raw.github.com/coderifous/dotfiles/master/get.vimfiles.sh | sh

# If you have a fork, change this variable. The other ones should be fine.
REPO_OWNER="coderifous"


REPO_NAME="dotfiles"
GIT_REPO_URL="git://github.com/$REPO_OWNER/$REPO_NAME.git"
# Replace the hostname, username and repository name as required to use your
# own fork instead of Coderifous's.
GIT_REPO_URL="[email protected]:coderifous/$REPO_NAME.git"

echo -e "\033[32mDownloading repository."
echo -e "\033[0m"
Expand All @@ -22,25 +20,46 @@ git clone $GIT_REPO_URL
echo
echo -e "\033[32mUpdating submodules."
echo -e "\033[0m"

echo "REPO_NAME = $REPO_NAME"
cd $REPO_NAME
git submodule update --init

backup_file() {
if [ -e $1 ] || [ -L $1 ];
then
bakext=".bak"
bakfile=$1$bakext
echo -e "\033[32mBacking up \"$1\" to \"$bakfile\"."
echo -e "\033[0m"
mv $1 $bakfile
fi
}

echo
echo -e "\033[32mCreating dotfile links in home dir."
echo -e "\033[0m"

VIMHOME=`pwd`"/vim"

ln -s $VIMHOME ~/.vim
ln -s ~/.vim/vimrc ~/.vimrc
backup_file ~/.vim
ln -s $VIMHOME ~/.vim

backup_file ~/.vimrc
ln -s ~/.vim/vimrc ~/.vimrc

backup_file ~/.gvimrc
ln -s ~/.vim/gvimrc ~/.gvimrc

echo
echo -e "\033[32mCreating ~/.vim_tmp: where vim is configured to store temporary files."
echo -e "\033[0m"

mkdir ~/.vim_tmp
if [ ! -d ~/.vim_tmp ];
then
echo
echo -e "\033[32mCreating ~/.vim_tmp: where vim is configured to store temporary files."
echo -e "\033[0m"
mkdir ~/.vim_tmp
fi

#end

echo
echo -e "\033[32mVim dotfiles installed!"
Expand Down