-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvim-setup.sh
37 lines (32 loc) · 869 Bytes
/
vim-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
#!/bin/bash
setup_pathogen() {
echo "Setting up ~/.vim/autoload and ~/.vim/bundle (if not already present)..."
mkdir -p ~/.vim/autoload ~/.vim/bundle
echo "Getting pathogen (if not already present)..."
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
}
setup_plugins() {
repos=(
https://github.com/bling/vim-airline
https://tpope.io/vim/fugitive
https://github.com/preservim/nerdtree
https://github.com/airblade/vim-gitgutter
https://github.com/rust-lang/rust.vim
)
BUNDLE_PATH="$HOME/.vim/bundle"
for i in "${repos[@]}"; do
PATHNAME="${BUNDLE_PATH}/${i##*/}"
if [ ! -d "${PATHNAME}" ]; then
git clone "$i" "$PATHNAME"
else
echo "\"${PATHNAME}\" already present, updating..."
(cd "${PATHNAME}" && git pull)
fi
done
}
setup_vim() {
setup_pathogen
setup_plugins
cp .vimrc ~/.vimrc
}
setup_vim