-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·40 lines (29 loc) · 1.07 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
#!/bin/bash
set -xe
cd "$(dirname "$0")"
git submodule init
git submodule update --init --recursive
\mkdir -p ~/.backup
[[ -f ~/.vimrc ]] && mv ~/.vimrc ~/.backup/.vimrc
[[ -d ~/.vim ]] && mv ~/.vim ~/.backup/.vim
[[ -d ~/.tmux ]] && mv ~/.tmux ~/.backup/.tmux
[[ -f ~/.tmux.conf ]] && mv ~/.tmux.conf ~/.backup/.tmux.conf
[[ -f ~/.bash.conf ]] && mv ~/.bash.conf ~/.backup/.bash.conf
[[ -d ~/.bash_addons ]] && mv ~/.bash_addons ~/.backup/.bash
[[ -f ~/.globalrc ]] && mv ~/.globalrc ~/.backup/.globalrc
[[ -d ~/.config/nvim ]] && mv ~/.config/nvim ~/.backup/nvim
GIT_ROOT=$(git rev-parse --show-toplevel)
ln -s ${GIT_ROOT}/vimrc ~/.vimrc
ln -s ${GIT_ROOT}/vim ~/.vim
ln -s ${GIT_ROOT}/tmux ~/.tmux
ln -s ${GIT_ROOT}/tmux.conf ~/.tmux.conf
ln -s ${GIT_ROOT}/bash.conf ~/.bash.conf
ln -s ${GIT_ROOT}/bash ~/.bash_addons
ln -s ${GIT_ROOT}/globalrc ~/.globalrc
ln -s ${GIT_ROOT}/nvim ~/.config/nvim
echo "source ~/.bash.conf" >> ~/.bashrc
# Git
echo "[include]" >> ~/.gitconfig
echo "path = ${GIT_ROOT}/gitconfig" >> ~/.gitconfig
# gdb
echo "source ${GIT_ROOT}/gdbinit" >> ~/.gdbinit