forked from sloanelybutsurely/vimrc.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·73 lines (55 loc) · 1.51 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
#!/bin/bash
set -e
VIMRC=~/.vimrc
AUTOLOAD=~/.vim/autoload
VIMEXE=vim
if (which nvim > /dev/null); then
VIMRC=~/.config/nvim/init.vim
AUTOLOAD=~/.config/nvim/autoload
VIMEXE=nvim
fi
cat <<WhatWillHappen
I detected that you're using $VIMEXE.
I'm going to...
- clone vimrc.js into '~/.vimrc.js'
- install vim-plug
- move your existing vimrc
from: '$VIMRC'
to: '$VIMRC.bak'
- symlink
from: '$VIMRC'
to: '~/.vimrc.js/vimrc'
- install all plugins listed in
'~/.vimrc.js/vimrc.plugs'
If you're not comfortable with these plans,
you can abort now by pressing <C-c>.
WhatWillHappen
read THROW_AWAY
echo -n "Installing vim-plug... "
curl -sfLo $AUTOLOAD/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
echo "done."
echo -n "Installing vimrc.js... "
git clone --quiet https://github.com/zperrault/vimrc.js.git ~/.vimrc.js
echo "done."
if [[ -f $VIMRC ]]; then
echo -n "Backing up existing vimrc... "
mv $VIMRC $VIMRC.bak
echo "done."
fi
echo -n "Linking vimrc... "
ln -s ~/.vimrc.js/vimrc $VIMRC
echo "done."
echo -n "Installing plugins... "
command $VIMEXE +PlugInstall +qall
echo "done."
cat <<NowThatWeAreDone
Now that we are done you can...
- add your own plugins to:
'~/.vimrc.js/vimrc.plugs.local'
- add your own settings to:
'~/.vimrc.js/vimrc.local'
If you add any new plugins to your 'plugs.local'
file, make sure to run ':PlugInstall' from
within $VIMEXE.
NowThatWeAreDone