-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.sh
executable file
·100 lines (90 loc) · 2.28 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
#!/bin/bash
# Base Script File (install.sh)
# Created: Mon Jul 1 15:03:41 2013
# Version: 1.0
# Author: François-Xavier Thomas <[email protected]>
#
# This Bash script was developped by François-Xavier Thomas.
# You are free to copy, adapt or modify it.
# If you do so, however, leave my name somewhere in the credits, I'd appreciate it ;)
BASEDIR=$(pwd)
function copyconf {
IN="$BASEDIR/$1"
OUT="$2/$1"
if [ -e "$OUT" ]; then
echo ">>> $OUT exists. Overwrite? (y/N) "
read _ok
else
echo -n ">>> $IN -> $OUT"
_ok='y'
fi
if [[ $_ok == 'y' ]]; then
rm -rvi "$OUT"
cp "$IN" "$OUT" >/dev/null 2>&1
fi
}
function linkconf {
IN="$BASEDIR/$1"
OUT="$2/${3:-$1}"
if [ -e "$OUT" ]; then
echo ">>> $OUT exists. Overwrite? (y/N) "
read _ok
else
echo -n ">>> $IN -> $OUT"
_ok='y'
fi
if [[ $_ok == 'y' ]]; then
rm -rvi "$OUT"
ln -s "$IN" "$OUT" >/dev/null 2>&1
fi
}
# Update submodules
echo "Updating submodules..."
git submodule init
git submodule update
# Link configuration
echo "Linking configuration..."
linkconf .oh-my-zsh ~
linkconf .bash_profile ~
linkconf .bashrc ~
linkconf .gdbinit ~
copyconf .gitconfig ~
linkconf .gitbase ~
linkconf .gitignore_global ~
linkconf .lftp ~
linkconf .tmux.conf ~
linkconf .vim ~
linkconf .vimrc ~
linkconf .zshrc ~
linkconf .aliases ~
linkconf .profile ~
linkconf .psqlrc ~
linkconf .npmrc ~
linkconf .multitailrc ~
linkconf nvim ~/.config/nvim
linkconf fx.zsh-theme ~/.oh-my-zsh/themes
mkdir -p ~/.config/htop && linkconf htoprc ~/.config/htop
mkdir -p ~/.config/mpv && linkconf mpv/mpv.conf ~/.config/mpv
mkdir -p ~/.config && linkconf flake8 ~/.config
# Install Vim bundles
echo "Installing Vim bundles..."
vim +PluginInstall +qall
# Make Vimproc
echo "Compiling Vimproc..."
UNAME=`uname`
if [[ "$UNAME" == "Linux" ]]; then
cd .vim/bundle/vimproc.vim && make -f make_unix.mak
elif [[ "$UNAME" == "FreeBSD" ]]; then
cd .vim/bundle/vimproc.vim && make -f make_unix.mak
elif [[ "$UNAME" == "Darwin" ]]; then
cd .vim/bundle/vimproc.vim && make -f make_mac.mak
else
echo "Unable to compile Vimproc for your architecture... [$UNAME]"
fi
# Make YCM
if [[ -f ~/.vim/bundle/YouCompleteMe/install.py ]]; then
echo "Compiling YCM..."
cd ~/.vim/bundle/YouCompleteMe && ./install.py
fi
# Finish!
echo "All done!"