-
Notifications
You must be signed in to change notification settings - Fork 14
/
vim.sh
executable file
·40 lines (31 loc) · 863 Bytes
/
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
#!/bin/bash
# shellcheck source=/dev/null
cd "$DOTFILES_PATH" \
&& source "$DOTFILES_PATH/src/os/helpers.sh"
#------------------------------------------------------------------------------#
install_plugins() {
declare -r VUNDLE_DIR="$HOME/.vim/bundles/Vundle.vim"
declare -r VUNDLE_URL="https://github.com/VundleVim/Vundle.vim"
execute \
"rm -rf '$VUNDLE_DIR' \
&& git clone --quiet '$VUNDLE_URL' '$VUNDLE_DIR' \
&& printf '\n' | vim +PluginInstall +qall" \
"Install plugins" \
|| return 1
}
update_plugins() {
execute \
"vim +PluginUpdate +qall" \
"Update plugins"
}
#------------------------------------------------------------------------------#
main() {
printf "\n"
print_title "Vim"
if [ ! -f "$HOME/.vim/bundles/Vundle.vim/README.md" ]; then
install_plugins
else
update_plugins
fi
}
main