-
Notifications
You must be signed in to change notification settings - Fork 0
/
updaterc.sh
executable file
·44 lines (40 loc) · 1.2 KB
/
updaterc.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
#!/bin/bash
[[ -f ~/.zshrc ]] && mv ~/.zshrc ~/.zshrc.bak
cp .zshrc ~/.zshrc
exec zsh -l
$SUDO chsh -s $(which zsh)
#
# install rc files
#
for file_path in $(find $PWD -type f -name ".*" ); do
fname=$(basename $file_path)
if ! [ "$fname" = ".zshrc" ] &&
! [ "$fname" = ".gitconfig" ]; then
ln -sf $file_path $HOME/$fname;
fi
done
cat .gitconfig >> ~/.gitconfig
cat .zshrc >> ~/.zshrc
#
# tmux 2.x config
#
TMUX_VERSION=$(tmux -V | cut -d' ' -f2)
if [[ "${TMUX_VERSION:0:1}" == "2" ]]; then
sed -i 's/bind \\\\ split-window -h/bind \\ split-window -h/g' ~/.tmux.conf
fi
#
# install vim-plug
#
if [[ ! -f ~/.vim/autoload/onedark.vim ]]; then
curl -sfLo ~/.vim/autoload/onedark.vim --create-dirs \
https://raw.githubusercontent.com/joshdick/onedark.vim/master/autoload/onedark.vim
fi
if [[ ! -f ~/.vim/colors/onedark.vim ]]; then
curl -sfLo ~/.vim/colors/onedark.vim --create-dirs \
https://raw.githubusercontent.com/joshdick/onedark.vim/master/colors/onedark.vim
fi
if [[ ! -f ~/.vim/autoload/plug.vim ]]; then
curl -sfLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
vim +PlugInstall +qall
fi