Scripts(nvim): Check nvim existence and optionally upgrade vim-plug
This commit is contained in:
parent
9bc6938e4a
commit
6c453aaccd
|
@ -1,11 +1,20 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
if ! command -v nvim &> /dev/null; then
|
||||
echo "ERROR: nvim not found"
|
||||
fi
|
||||
|
||||
DEST=${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim"
|
||||
|
||||
if ! [[ -f "$DEST" ]]; then
|
||||
echo "installing vim-plug for nvim"
|
||||
sh -c 'curl -fLo "$DEST" --create-dirs \
|
||||
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
||||
echo "installing nvim plugins"
|
||||
nvim +PlugInstall
|
||||
else
|
||||
echo "upgrading vim-plug"
|
||||
nvim +PlugUpgrade
|
||||
echo "upgrading nvim plugins"
|
||||
nvim +PlugUpdate
|
||||
fi
|
||||
echo "installing nvim plugins"
|
||||
nvim +PlugInstall
|
||||
|
|
Loading…
Reference in New Issue