-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·47 lines (39 loc) · 1.01 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
#!/bin/sh
USAGE="$(cat <<EOF
EOF
)"
while getopts 'hv' opt; do case "$opt" in
v) set -x ;;
h|*) echo "$USAGE" >&2; exit 1 ;;
esac done
shift $((OPTIND-1))
DIR="$( cd "`dirname "$0"`"; pwd )"
vimrc="$HOME/.vimrc"
vimfiles="$HOME/.vim"
ln -s -f "$DIR"/COPY_TO_HOME/_vimrc "$vimrc"
mkdir -p "$vimfiles"
# ~/vim-plug is where we put all the plugins managed by vim-plug
# However vim-plug itself is installed into ~/.vim/autoload
mkdir -p "$HOME/vim-plug"
mkdir -p "$vimfiles/autoload" && \
curl -fL \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim \
>"$vimfiles/autoload/plug.vim"
mkdir -p "$vimfiles/doc" && \
curl -fL \
https://raw.githubusercontent.com/junegunn/vim-plug/master/doc/plug.txt \
>"$vimfiles/doc/plug.txt"
case "$(uname -s)" in
*NT*)
(
cd "$HOME"
ln "$(realpath .vimrc)" "$(realpath _vimrc)"
cmd /c mklink /d vimfiles .vim
)
;;
esac
# build helptags for vim-plug
vim -es - <<EOF
helptags $HOME/$vimfiles/doc
qa
EOF