-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvim_plugins.sh
More file actions
executable file
·38 lines (32 loc) · 991 Bytes
/
vim_plugins.sh
File metadata and controls
executable file
·38 lines (32 loc) · 991 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
34
35
36
37
38
#!/bin/bash
# Download / update vim plugins
# setup vim-pathogen for managing plugins
mkdir -p $HOME/.vim/autoload $HOME/.vim/bundle && \
curl -LSso $HOME/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
# git repos for plugins
# format: github_username/repo_name
PLUGINS=( 'junegunn/fzf.vim' 'mattn/emmet-vim' 'morhetz/gruvbox'
'scrooloose/nerdcommenter' 'scrooloose/nerdtree' 'tpope/vim-fugitive' )
for p in "${PLUGINS[@]}"; do
# github url
URL="https://github.com/$p"
# repo name, no username
REPO=`echo $p | cut -d '/' -f 2`
# local path to directory where repo will be cloned
DIR="$HOME/.vim/bundle/$REPO"
# if local directory already exists update, else clone
if cd $DIR; then
# update
git pull
else
# download
git clone $URL $DIR
fi
done
# fzf (for fzf.vim)
if ! cd ~/.fzf; then
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf &&
~/.fzf/install
fi
# Ag (for fzf.vim fast search)
sudo apt install -y silversearcher-ag