Auto update vim packages

This commit is contained in:
Thomas Forgione 2019-04-03 18:26:51 +02:00
parent 0647cc3351
commit 898301ced0
No known key found for this signature in database
GPG Key ID: BFD17A2D71B3B5E7
1 changed files with 20 additions and 0 deletions

View File

@ -236,6 +236,22 @@ update-dotfiles() {
echo "\033[32;1m=== Dotfiles updated in $formatted ===\033[0m"
}
update-neovim() {
command -v nvim > /dev/null 2&>1
if [ $? -ne 0 ]; then
return
fi
start_neovim_update=`date +%s`
echo "\033[32;1m=== Updating neovim packages ===\033[0m"
nvim +PlugUpdate +qall
seconds=$((`date +%s` - $start_neovim_update ))
formatted=`date -ud "@$seconds" +'%H hours %M minutes %S seconds'`
echo "\033[32;1m=== Neovim updated in $formatted ===\033[0m"
}
main() {
if [ $# -eq 0 ]; then
@ -255,6 +271,9 @@ main() {
# Update the dotfiles
update-dotfiles
# Update the neovim packages
update-neovim
format=`_date_format`
if [ $? -eq 0 ]; then
@ -274,6 +293,7 @@ main() {
"rust") update-rust;;
"npm") update-npm;;
"dotfiles") update-dotfiles;;
"neovim") update-neovim;;
"check") _check_date_if_format;;
esac