-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvim_packages
executable file
·47 lines (38 loc) · 1.17 KB
/
vim_packages
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
#!/bin/bash
function installvimpackage() {
# Install Vim package based on URL that is passed
# as the first argument.
# Setup variables URL the name of the package
# and the install directory
url=$1
name=`echo $url | awk -F'[/\\\\.]' '{print $(NF-1)}'`
packagedir=$packdir/$name
# Give some screen feed back to let the user
# know what is going on
echo "Install package ${name}"
echo "from URL: ${url}"
echo "to package directory: $packagedir"
# Check if the package directory exists
# if now then install the package by cloning
# the URL to the given folder.
if [[ ! -d $packagedir ]]
then
git clone $url $packagedir
fi
# Add the help docuementation to the Vim help
vim -u NONE -c "helptags $packagedir/doc" -c "q"
# Add empty line to separate output text
echo ""
}
# Create package directory if it doesn't exist
packdir="$HOME/.vim/pack/plugins/start"
echo "Installing packages to $packdir"
mkdir --verbose --parent -- $packdir
echo ""
urls=(
"https://github.com/Yggdroot/indentLine.git"
"https://tpope.io/vim/commentary.git"
)
for url in ${urls[@]}; do
installvimpackage $url
done