30 lines
821 B
Bash
Executable file
30 lines
821 B
Bash
Executable file
#!/bin/sh
|
|
|
|
SCRIPT=$(readlink -f "$0")
|
|
SCRIPTPATH=$(dirname "$SCRIPT")
|
|
HOST=$(hostname)
|
|
|
|
# List of the config files to install
|
|
FILES="vimrc zshrc gitconfig vim gitignore_global git_user ctags.d"
|
|
|
|
if [ ! -e "$HOME/.git_user" ]; then
|
|
cp "$SCRIPTPATH/git_user.def" "$SCRIPTPATH/git_user"
|
|
sed -i -e "s/{username}/$USER/" "$SCRIPTPATH/git_user"
|
|
sed -i -e "s/{email}/$USER@$HOST/" "$SCRIPTPATH/git_user"
|
|
fi
|
|
|
|
# Init or update submodules
|
|
cd "$SCRIPTPATH"
|
|
git submodule update --init --recursive
|
|
cd -
|
|
|
|
# Setup fast-syntax-highlighting theme customization
|
|
cp "$SCRIPTPATH/fsh_theme.zsh" "$SCRIPTPATH/fast-syntax-highlighting/current_theme.zsh"
|
|
|
|
# Create symbolic links in the user's home dir
|
|
for file in $FILES
|
|
do
|
|
if [ ! -e "$HOME/.${file}" ]; then
|
|
ln -s "${SCRIPTPATH}/${file}" "$HOME/.${file}"
|
|
fi
|
|
done
|