-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·33 lines (27 loc) · 1007 Bytes
/
install.sh
File metadata and controls
executable file
·33 lines (27 loc) · 1007 Bytes
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
#!/bin/bash
BASEDIR=$(dirname $0)
cd $BASEDIR
CURRENT_DIR=`pwd`
TARGET_DIR=$HOME/.vim
echo "Step1: backing up current vim config"
today=`date +%Y%m%d`
for i in $HOME/.vim $HOME/.vimrc $HOME/.gvimrc $HOME/.vimrc.bundles; do [ -e $i ] && [ ! -L $i ] && mv $i $i.$today; done
for i in $HOME/.vim $HOME/.vimrc $HOME/.gvimrc $HOME/.vimrc.bundles; do [ -L $i ] && unlink $i ; done
echo "Step2: copy configure profiles"
cp $CURRENT_DIR/vimrc $HOME/.vimrc
cp $CURRENT_DIR/vimrc.bundles $HOME/.vimrc.bundles
echo "Step3: install vundle"
if [ ! -e $TARGET_DIR/bundle/Vundle.vim ]; then
echo "Installing Vundle"
git clone https://github.com/vundleVim/Vundle.vim.git $TARGET_DIR/bundle/Vundle.vim
else
echo "Upgrade Vundle"
cd "$TARGET_DIR/bundle/Vundle.vim" && git pull origin main
fi
echo "Step4: update/install plugins using Vundle"
system_shell=$SHELL
export SHELL="/bin/sh"
vim -u $HOME/.vimrc +PluginInstall! +PluginClean +qall
export SHELL=$system_shell
echo "Completely installed!"
# Done