-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_vim.sh
executable file
·60 lines (55 loc) · 1.83 KB
/
setup_vim.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
#! /usr/bin/env bash
if [ ! -f "${HOME}/.vim/autoload/pathogen.vim" ]; then
echo "Setting up pathogen..."
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
else
echo "Pathogen is already configured."
fi
plugins=(
"https://github.com/rust-lang/rust.vim.git"
"https://github.com/vim-syntastic/syntastic.git"
"https://github.com/godlygeek/tabular.git"
"https://github.com/vim-airline/vim-airline-themes.git"
"https://github.com/ntpeters/vim-better-whitespace.git"
"https://github.com/vim-crystal/vim-crystal.git"
"https://github.com/tpope/vim-eunuch.git"
"https://github.com/tpope/vim-fugitive.git"
"https://github.com/airblade/vim-gitgutter.git"
"https://github.com/fatih/vim-go.git"
"https://github.com/tpope/vim-repeat.git"
"https://github.com/vim-ruby/vim-ruby.git"
"https://github.com/tpope/vim-sensible.git"
"https://github.com/tpope/vim-surround.git"
"https://github.com/hashivim/vim-terraform.git"
"https://github.com/stephpy/vim-yaml.git"
"https://github.com/vim-python/python-syntax.git"
"https://github.com/ycm-core/YouCompleteMe.git"
)
# Setup our bundles directory for vim & clone down or pull latest for each repo
mkdir -p ~/.vim/bundle
pushd ~/.vim/bundle
for repo in "${plugins[@]}"
do
# Note that this looks really terrible to me, but grabbing a capture group
# in a shell regex is a PITA.
dir=$(cut -f 5 -d '/' <<< "${repo}" | rev | cut -c 5- | rev)
if [[ ! -d $dir ]]
then
echo "Cloning ${repo}"
git clone $repo
else
# skip YouCompleteMe because it's very finicky
if [[ "YouCompleteMe" != $dir ]]
then
echo "${repo} already cloned, pulling latest"
pushd $dir
git pull
popd
else
echo "Skipping updates to YouCompleteMe"
fi
fi
done
# And head back to wherever we started from
popd