-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall
executable file
·47 lines (40 loc) · 1.66 KB
/
install
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
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# Very convoluted but best way I can find to get the full path for the symlink
pushd $(pwd)/$(dirname $0) > /dev/null && SRC=$(pwd) && popd > /dev/null
pushd "$SRC" > /dev/null # work in the directory the script is in
# All of the simple thing that need a simple link
LINK="tmux.conf zshrc zshenv vimrc gitignore_global"
for f in $LINK; do
if [ -e "$HOME/.$f" ]; then
if [[ $* == *--overwrite* ]]; then
echo "[ dotfiles ] $f exists – removing and relinking"
rm "$HOME/.$f" && ln -s "$SRC/$f" "$HOME/.$f"
else
echo "[ dotfiles ] $f exists – skipping"
fi
else
echo "[ dotfiles ] $f does not exist – linking"
ln -s "$SRC/$f" "$HOME/.$f"
fi
done
# Install vundle
mkdir -p "$HOME/.vim/bundle"
rm -Rf "$HOME/.vim/bundle/"
git clone -q "https://github.com/VundleVim/Vundle.vim.git" "$HOME/.vim/bundle/Vundle.vim"
# Install vim plugins
vim +PluginInstall +qall
# Set up git
if [[ ! -e "$HOME/.gitconfig" ]]; then
echo "[ gitconfig ] writing basic git config"
git config --global core.excludesfile "$SRC/.gitignore_global"
git config --global user.name "Matthew Terwilliger"
git config --global user.email "[email protected]"
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
git config --global pull.rebase true
git config --global help.autocorrect 5
git config --global rebase.autostash true
# git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"
else
echo "[ gitconfig ] gitconfig exists – skipping"
fi
popd > /dev/null