forked from mdumitru/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·102 lines (75 loc) · 1.39 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/bin/zsh
show_usage() {
cat <<- __EOF__
Running this script with no arguments will install config files for zsh,
vim, nvim and gdb.
Pass individual arguments to fine-tune the installation.
Arguments are of the form "install_XXX".
Example:
$0 install_zsh install_vim
__EOF__
}
install_zsh() {
set -x
rm -rf ~/.zsh
ln -fs `realpath ./.zsh` ~
ln -fs `realpath ./.zshrc` ~
zsh -c "source ~/.zshrc"
set +x
}
nvim_python() {
set -x
if command -v pip2 &> /dev/null; then
pip2 install --user -U neovim
fi
if command -v pip3 &> /dev/null; then
pip3 install --user -U neovim
fi
if command -v pip &> /dev/null; then
pip install --user -U neovim
fi
set +x
}
install_vim() {
set -x
rm -rf ~/.vim
ln -fs `realpath ./.vim` ~
ln -fs `realpath ./.vimrc` ~
ln -fs `realpath ./.gvimrc` ~
if command -v nvim &> /dev/null; then
mkdir -p ~/bin
rm -rf ~/bin/nvim
for file in `ls ./bin`; do
ln -fs `realpath ./bin/$file` ~/bin/
done
mkdir -p ~/.config/nvim
ln -fs ~/.vimrc ~/.config/nvim/init.vim
nvim_python
fi
set +x
}
install_ycm() {
set -x
ln -fs `realpath ./.ycm_extra_conf.py` ~
set +x
}
install_screen() {
set -x
ln -fs `realpath ./.screenrc` ~
set +x
}
main() {
install_zsh
install_vim
install_ycm
install_screen
}
if [[ $# == 0 ]]; then
main
elif [[ $1 == --help || $1 == -h ]]; then
show_usage
else
for arg in $@; do
"$arg"
done
fi