clean up vim packages and logic, make script safer to re-run

This commit is contained in:
2016-01-07 22:06:15 -07:00
parent 82bbb14862
commit 37e501e021

View File

@@ -2,13 +2,9 @@
# configure vim bundles
VIM_BUNDLES=(
'git://github.com/vim-scripts/phpfolding.vim.git'
'git://github.com/msanders/snipmate.vim.git'
'git://github.com/scrooloose/syntastic.git'
'git://github.com/kchmck/vim-coffee-script.git'
'git://github.com/altercation/vim-colors-solarized.git'
'git://github.com/digitaltoad/vim-jade.git'
'git://github.com/wavded/vim-stylus.git'
'git://github.com/tpope/vim-surround.git'
)
@@ -20,30 +16,37 @@ if [ ! $? == 0 ]; then
fi
ROOT=`pwd`
# pre-run cleanup
rm -rf bash/bash_magic vim/bundle/* "${HOME}"/.vimrc
###
# bash
###
#clone repo
$GIT clone git://github.com/Knewton/bash_magic.git bash/bash_magic
# clone bash_magic repo
if [ ! -d bash/bash_magic ]; then
$GIT clone git://github.com/w33ble/bash_magic.git bash/bash_magic
fi
# install select bash magic scripts
cd "bash/bash_magic"
mkdir "${HOME}/bin" "${HOME}/.bash_aliases.d" "${HOME}/.bash_completion.d" "${HOME}/.bash_functions.d"
cd "bash_aliases.d"
cp color.sh refresh.sh "${HOME}/.bash_aliases.d"
cd "../bash_completion.d"
cp etc.sh "${HOME}/.bash_completion.d"
cd "../bash_functions.d"
cp completion.sh extract.sh lsbytes.sh lsnew.sh vim.sh "${HOME}/.bash_functions.d"
cd "${ROOT}"
mkdir -p "${HOME}/bin" "${HOME}/.bash_aliases.d" "${HOME}/.bash_completion.d" "${HOME}/.bash_functions.d"
cd "${ROOT}/bash/bash_magic/bash_aliases.d";
for i in color refresh; do cp "${i}.sh" "${HOME}/.bash_aliases.d"; done
cd "${ROOT}/bash/bash_magic/bash_completion.d";
for i in etc; do cp "${i}.sh" "${HOME}/.bash_completion.d"; done
cd "${ROOT}/bash/bash_magic/bash_functions.d";
for i in completion extract lsbytes lsnew vim; do cp "${i}.sh" "${HOME}/.bash_functions.d"; done
# install custom bash scripts
cp "bash/bash_aliases.d/"*.sh "${HOME}/.bash_aliases.d"
#cp "bash/bash_completion.d/"*.sh "${HOME}/.bash_completion.d"
#cp "bash/bash_functions.d/"*.sh "${HOME}/.bash_functions.d"
cp "${ROOT}/bash/bash_aliases.d/"*.sh "${HOME}/.bash_aliases.d"
# cp "${ROOT}/bash/bash_completion.d/"*.sh "${HOME}/.bash_completion.d"
# cp "${ROOT}/bash/bash_functions.d/"*.sh "${HOME}/.bash_functions.d"
# set up the bash_profile file
cp bash/bash_profile "${HOME}"/.bash_profile
cat "bash/bash_magic/bashrc" >> "${HOME}"/.bash_profile
cp "${ROOT}/bash/bash_profile" "${HOME}"/.bash_profile
# add bash_magic logic to bash profile
cat "${ROOT}/bash/bash_magic/bashrc" >> "${HOME}"/.bash_profile
if [ ! -f "${HOME}"/.bashrc ]; then
ln -s "${HOME}"/.bash_profile "${HOME}"/.bashrc
fi
@@ -51,7 +54,8 @@ fi
###
# dotfiles
###
cd dotfiles
cd "${ROOT}/dotfiles"
for i in *; do
cp "${i}" "${HOME}/.${i}"
done
@@ -60,19 +64,27 @@ cd "${ROOT}"
###
# git
###
# collect git user info, create config file
echo -n "Enter your git name: "
read NAME
echo -n "Enter you git email: "
read EMAIL
echo -e "[user]\n\tname = ${NAME}\n\temail = ${EMAIL}" > "${HOME}"/.gitconfig
cat git/gitconfig >> "${HOME}"/.gitconfig
cp git/githelpers "${HOME}"/.githelpers
# add custom config and helpers
cat "${ROOT}"/git/gitconfig >> "${HOME}"/.gitconfig
cp "${ROOT}"/git/githelpers "${HOME}"/.githelpers
###
# vim
###
# clone bundle repos
cd "vim/bundle"
echo "${ROOT}/vim/bundle"
cd "${ROOT}/vim/bundle"
pwd
for b in ${VIM_BUNDLES[@]}; do
$GIT clone "${b}"
done