Vim Plugin Management#
I use vim-plug for managing plugins.
Setup Script#
This script automates the installation of vim-plug and the plugins defined in vimrc.
#!/bin/bash
# Target files
VIMRC_FILE="$HOME/.vimrc"
VIM_DIR="$HOME/.vim"
# 1. Install vim-plug if it doesn't exist
if [[ ! -f "$VIM_DIR/autoload/plug.vim" ]]; then
echo "Installing vim-plug..."
curl -fLo "$VIM_DIR/autoload/plug.vim" --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
fi
# 2. Install plugins
echo "Installing Vim plugins..."
vim +PlugInstall +qall
echo "Vim configuration set up successfully."