-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinitialize
executable file
·36 lines (30 loc) · 901 Bytes
/
initialize
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
#!/bin/bash
# You should only need to run this once.
# However, you can run multiple times,
# it should not change anything after the first run.
# ----- remove fork files used by spf13-vim
vimrc_forc_files=(
'.vimrc.before.fork'
'.vimrc.bundles.fork'
'.vimrc.fork'
)
for file in "${vimrc_forc_files[@]}"; do
if [ -e "$HOME/${file}" ]; then
rm -i "$HOME/${file}"
fi
done
remove_link() {
if [ -h "$HOME/$1" ] ; then rm -i "$HOME/$1"; fi
}
# ----- rewrite vimrc files
vimrc_files=('.vimrc.before.local' '.vimrc.bundles.local' '.vimrc.local')
for file in "${vimrc_files[@]}"; do
remove_link $file
echo "exe 'source' \"$PWD/${file}\"" > "$HOME/${file}"
done
# ----- rewrite .zshrc file
remove_link '.zshrc'
echo "source $PWD/.zshrc" > "$HOME/.zshrc"
# ----- rewrite .tmux.conf file
remove_link '.tmux.conf'
echo "run-shell 'tmux source-file $PWD/.tmux.conf'" > "$HOME/.tmux.conf"