-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·72 lines (61 loc) · 1.68 KB
/
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
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
68
69
70
71
72
#!/bin/bash
# symbolic links to home folder
link_file() {
source="${PWD}/$1"
target="${HOME}/${1/_/.}"
if [ -e $target ] ; then
if [ ! -d $target ] ; then
echo "Update $target"
mv $target $target.bak
ln -sf ${source} ${target}
fi
else
echo "Install $target"
ln -sf ${source} ${target}
fi
}
# change default shell to zsh
if [ $SHELL != "/bin/zsh" ]
then
echo "setting shell to zsh"
chsh -s /bin/zsh
fi
# install vundle
if [ ! -d $HOME/.vim/bundle/Vundle.vim ]
then
echo "installing vundle"
sh -c "git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim"
fi
# install homebrew
command -v brew >/dev/null 2>&1 || { echo >&2 "installing homebrew"; \
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"; }
# install brew things
command -v ctags >/dev/null 2>&1 || { echo >&2 "installing ctags"; \
brew install ctags; \
brew install the_silver_searcher; }
# install oh-my-zsh
if [ ! -d $HOME/.oh-my-zsh ]
then
echo "installing oh-my-zsh"
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
fi
# install fzf
if [ ! -d $HOME/.fzf ]
then
echo "installing fzf"
sh -c "git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf && ~/.fzf/install"
fi
echo "creating/updating symlinks"
for i in _*
do
link_file $i
done
# install oh-my-zsh themes
echo "installing oh-my-zsh themes"
cp oh-my-zsh/themes/gitster.zsh-theme $HOME/.oh-my-zsh/themes/
mkdir -p $HOME/.bin
ln -sf ${PWD}/bin/cs $HOME/.bin/cs
ln -sf ${PWD}/bin/wea $HOME/.bin/wea
curl -o ~/.bin/tldr https://raw.githubusercontent.com/raylee/tldr/master/tldr
curl https://cht.sh/:cht.sh > ~/.bin/cht
chmod +x ~/.bin/cht