-
Notifications
You must be signed in to change notification settings - Fork 3
/
install.sh
executable file
·84 lines (69 loc) · 2.22 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
73
74
75
76
77
78
79
80
81
82
83
#!/bin/sh
set -ux
function export_first_path_if_exists() {
test -d "$1" && export PATH="$1:$PATH"
}
function export_path_if_exists() {
test -d "$1" && export PATH="$1:$PATH"
}
function source_if_exists() {
test -f "$1" && source "$1"
}
function eval_if_exists() {
test -f $(which $1) && eval "$2"
}
function mv_old_if_exists() {
test -f $1 && mv $1 $1.old
}
echo "### dotfiles"
mkdir -p ~/src
[ -d ~/src/dotfiles ] && git clone [email protected]:mainyaa/dotfiles.git ~/src/dotfiles
cd ~/src/dotfiles
[ -f ~/.zshrc ] && mv ~/.zshrc ~/.zshrc.old
[ -f ~/.bashrc ] && mv ~/.bashrc ~/.bashrc.old
[ -f ~/.bash_profile ] && mv ~/.bash_profile ~/.bash_profile.old
[ -f ~/.vim ] && mv ~/.vim ~/.vim.old
[ -f ~/.vimrc ] && mv ~/.vimrc ~/.vimrc.old
ln -s ~/src/dotfiles/.zshrc ~/
ln -s ~/src/dotfiles/.zshrc.antigen ~/
ln -s ~/src/dotfiles/.zlogout ~/
ln -s ~/src/dotfiles/.bashrc ~/
ln -s ~/src/dotfiles/.bash_profile ~/
ln -s ~/src/dotfiles/.bash_env ~/
ln -s ~/src/dotfiles/.bash_mac ~/
ln -s ~/src/dotfiles/.bash_linux ~/
ln -s ~/src/dotfiles/.bash_logout ~/
ln -s ~/src/dotfiles/.editorconfig ~/
ln -s ~/src/dotfiles/.gemrc ~/
ln -s ~/src/dotfiles/.gitconfig ~/
ln -s ~/src/dotfiles/.gitconfig_mac ~/
ln -s ~/src/dotfiles/.git_template ~/
ln -s ~/src/dotfiles/.tmux.conf ~/
ln -s ~/src/dotfiles/.gitignore_global ~/
ln -s ~/src/dotfiles/irbrc ~/.irbrc
ln -s ~/src/dotfiles/pryrc ~/.pryrc
echo "### vim"
mkdir -p ~/.txta
mkdir -p ~/.txtb
mkdir -p ~/_vim/autoload
mkdir -p ~/_vim/bundle
git clone https://github.com/gmarik/vundle.git ~/_vim/vundle.git
ln -s ~/src/dotfiles/vimfiles/_vim ~/_vim
ln -s ~/src/dotfiles/vimfiles/_gvimrc ~/_gvimrc
ln -s ~/src/dotfiles/vimfiles/_vimrc ~/_vimrc
mkdir -p ~/_vim/dict
#wget https://raw.github.com/Cside/dotfiles/master/.vim/dict/perl.dict
#mv perl.dict ~/_vim/dict/
wget https://github.com/cooldaemon/myhome/blob/master/.vim/dict/javascript.dict
mv javascript.dict ~/_vim/dict/
mkdir -p ~/bin
#curl -L https://sdk.cloud.google.com | bash
curl -L https://raw.githubusercontent.com/git/git/master/contrib/diff-highlight/diff-highlight > ~/bin/diff-highlight
chmod +x ~/bin/diff-highlight
# vim
vim +BundleInstall +qall
if [ -d ~/_vim/bundle/vimproc.vim ]; then
cd ~/_vim/bundle/vimproc.vim
make
fi
cd ~