-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup
56 lines (47 loc) · 906 Bytes
/
setup
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
#!/bin/sh
FILES="
bashrc
ctags
gdbinit
gitconfig
guile
ipython
inputrc
lambda-term-inputrc
psqlrc
ripgreprc
tmux.conf
vim
vimrc
"
BASEDIR=$(pwd)
safe_link() {
in="$BASEDIR/$1"
if [ -z "$2" ]; then
out=".$1"
else
out="$2"
fi
cd ~
if [ -h "$out" ]; then
echo "Already symlinked $out"
cd $OLDPWD
return
elif [ -f "$out" ] || [ -d "$out" ]; then
if [ ! -f "._$1" ]; then
echo "There's an existing $out, moving to ._$1"
mv "$out" "$(dirname $out)/._$1"
else
echo "There's already ._$1, can't create backup, skipping..."
fi
fi
ln -s $in $out
echo "Symlinked $out"
cd $OLDPWD
}
for f in $FILES; do
safe_link "$f"
done
safe_link "fish" ".config/fish"
git submodule update --init
vim +PluginInstall +qall