-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
31 lines (26 loc) · 868 Bytes
/
bootstrap.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
# Variables
dir=$(pwd) # this directory
config=~ # config directory
file=.vimrc # file to symlink
# Check if directory exist
if [[ ! -e $config ]]; then
echo "Creating configuration directory"
mkdir -p $config
fi
# Change to the config directory
echo "Changing to the $config directory"
cd $config
# Check if vim-plug downloaded
if [ ! -f $config/.vim/autoload/plug.vim ]; then
echo "Installing vim-plug"
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
fi
# Delete existing config if exist
if [ -f $config/$file ]; then
echo "Delete existing config"
rm $config/$file
fi
# Make symlink
echo "Creating symlink to $file in config directory."
ln -s $dir/$file $config/$file