-
Notifications
You must be signed in to change notification settings - Fork 3
/
init
executable file
·67 lines (63 loc) · 2.12 KB
/
init
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
echo ' _ _ __ _ _'
echo ' __| | ___ | |_ / _(_) | ___ ___'
echo ' / _` |/ _ \| __| |_| | |/ _ \/ __|'
echo ' | (_| | (_) | |_| _| | | __/\__ \'
echo '(_)__,_|\___/ \__|_| |_|_|\___||___/'
git submodule init
git submodule update --recursive
files=( 'vimrc' 'vim' 'zshrc' 'zsh' 'tmux.conf' 'bashrc' 'profile' 'atom' 'gitconf' 'config' 'ideavimrc' 'pyenv' )
for file in ${files[@]}
do
echo ""
if [ -e "$HOME/.$file" ]
then
if [ -h "$HOME/.$file" ] && [ $(readlink "$HOME/.$file") = "$PWD/$file" ]
then
rm "$HOME/.$file"
else
echo "Moving current .$file"
mv -ivf "$HOME/.$file" "$HOME/${file}_$(date +%s)"
fi
fi
echo "Simlinking $file to $HOME"
ln -s "$PWD/$file" "$HOME/.$file"
if [ $? -eq 0 ]
then
echo "$PWD/$file ~> $HOME/.$file"
else
echo 'Install failed to symlink. See GitHub.com/BrandonRoehl/dotfiles for help'
exit 1
fi
done
git config --global alias.l 'log --graph --decorate --all'
git config --global core.excludesfile "$HOME/.gitconf/gitignore"
git config --global init.templatedir "$HOME/.gitconf/git_template/"
git config --global pull.rebase false
git config --global --add --bool push.autoSetupRemote true
git config --global core.editor "nvim"
if [ hash brew >/dev/null 2>&1 ]
then
echo 'Attempting to install brew'
if [ uname = "Darwin" ]
then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# brew install font-hack-nerd-font
# else
# sudo apt-get install build-essential curl git python-setuptools ruby
# ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)"
fi
fi
if [ uname = "Darwin" ]
then
defaults write .GlobalPreferences com.apple.mouse.scaling -1
fi
curl -L https://iterm2.com/shell_integration/zsh \
-o ~/.iterm2_shell_integration.zsh
# brew install coreutils vim tmux wget bash htop
# echo 'install rvm or upgrade rvm'
# curl -sSL https://get.rvm.io | bash -s stable
# if [ hash rvm >/dev/null 2>&1 ]
# then
# rvm cleanup all
# fi