-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·41 lines (34 loc) · 960 Bytes
/
install.sh
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
#!/bin/bash
# Install in ~/config
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd )"
# Shell Config
SHRC=~/.bashrc
case $SHELL in
*/zsh)
SHRC=~/.zshrc
;;
*/bash)
SHRC=~/.bashrc
;;
*)
echo "Unknown SHELL env"
esac
echo "# Ranger's Config" >> $SHRC
echo "test -e $DIR/.sh_profile && source $DIR/.sh_profile" >> $SHRC
echo "Apply Shell Config: exec \$SHELL"
# Vim Config
echo "source $DIR/.vimrc" >> ~/.vimrc
mkdir -p ~/.vim/.backup
mkdir -p ~/.vim/.swp
mkdir -p ~/.vim/.undo
# Git Config
git config --add --global include.path "$DIR/.gitconfig"
# DiffMerge: https://sourcegear.com/diffmerge/webhelp/sec__git.html
# Detla: https://github.com/dandavison/delta
if [[ "$OSTYPE" == "darwin"* ]]; then
git config --add --global include.path "$DIR/.gitconfig_diffmerge_mac"
git config --add --global include.path "$DIR/.gitconfig_delta_mac"
fi
# SSH Config
mkdir -p ~/.ssh/mux
cp -f $DIR/.ssh_config ~/.ssh/config