forked from chenzhiwei/vim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·41 lines (32 loc) · 866 Bytes
/
setup.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
#!/bin/bash
## Setup for VIM init
cd ~
ln -sf .vim/vimrc .vimrc
## Setup for nvim autoload
mkdir -p ~/.local/share/nvim/site/autoload
cd ~/.local/share/nvim/site/autoload
ln -sf ../../../../../.vim/bundle/vim-plug/plug.vim .
## Setup for NeoVIM init
mkdir -p ~/.config/nvim
cd ~/.config/nvim
ln -sf ../../.vim/vimrc init.vim
## Setup nvim to vim
NVIM=$(which nvim)
if [[ "$NVIM" == "" ]]; then
echo No nvim found
exit 1
fi
cd ~/.vim/bin
ln -sf $NVIM vi
ln -sf $NVIM vim
ln -sf $NVIM editor
if [[ -f $HOME/.bashrc ]] && ! grep -wq .vim/.bashrc $HOME/.bashrc; then
echo '. $HOME/.vim/.bashrc' >> $HOME/.bashrc
fi
if [[ -f $HOME/.bash_profile ]] && ! grep -wq .vim/.bashrc $HOME/.bash_profile; then
echo '. $HOME/.vim/.bashrc' >> $HOME/.bash_profile
fi
rm -f /usr/bin/vimdiff.nvim
## Install Plugins
. $HOME/.vim/.bashrc
vim +PlugInstall +qall