Update core ansible role to configure Vim globally

This commit is contained in:
Shaun Reed 2019-09-06 23:04:54 +00:00
parent 255673b519
commit 9a69416d89
1 changed files with 14 additions and 14 deletions

View File

@ -22,37 +22,37 @@ printf "\n${GREEN}Klips config files updated"\
mkdir -pv /etc/config-vim/backup/ mkdir -pv /etc/config-vim/backup/
printf "\n${GREEN}Backup directory created - $PWD/etc/config-vim/backup/${NORMAL}\n" printf "\n${GREEN}Backup directory created - $PWD/etc/config-vim/backup/${NORMAL}\n"
# Stash the current .vimrc # Copy cloned clonfig into user directory
mv -bv /home/kansible/.vimrc /etc/config-vim/backup/ cp /etc/config-vim/.vimrc ~/
printf "${RED}Your local .vimrc has been stashed in $PWD/etc/config-vim/backup/${NORMAL}\n\n"
# Copy our cloned config into the user home directory # Copy our cloned config into global directories
cp /etc/config-vim/.vimrc /home/kansible/ cp /etc/config-vim/.vimrc /usr/share/vim/vimfiles/vimrc
printf "${GREEN}New /home/kansible/.vimrc configuration installed.${NORMAL}\n" cp /etc/config-vim/.vimrc /etc/vim/vimrc
printf "${GREEN}New /usr/share/vim/vimfiles configuration installed.${NORMAL}\n"
# Reinstall Pathogen plugin manager for vim # Reinstall Pathogen plugin manager for vim
# https://github.com/tpope/vim-pathogen # https://github.com/tpope/vim-pathogen
printf "\n${RED}Removing any previous installations of Pathogen...${NORMAL}\n" printf "\n${RED}Removing any previous installations of Pathogen...${NORMAL}\n"
sudo rm -f /home/kansible/.vim/autoload/pathogen.vim sudo rm -f /usr/share/vim/vimfiles/autoload/pathogen.vim
# Install Pathogen # Install Pathogen
printf "\n${GREEN}Installing Pathogen plugin manager for Vim....\n"\ printf "\n${GREEN}Installing Pathogen plugin manager for Vim....\n"\
"\nIf they don't exist, we will create the following directories:\n"\ "\nIf they don't exist, we will create the following directories:\n"\
"/home/kansible/.vim/autoload/ ~/.vim/bundle/${NORMAL}" "/usr/share/vim/vimfiles/autoload/ /usr/share/vim/vimfiles/bundle/${NORMAL}"
mkdir -pv /home/kansible/.vim/autoload ~/.vim/bundle && \ mkdir -pv /usr/share/vim/vimfiles/autoload /usr/share/vim/vimfiles/bundle && \
sudo curl -LSso /home/kansible/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim sudo curl -LSso /usr/share/vim/vimfiles/autoload/pathogen.vim https://tpo.pe/pathogen.vim
printf "\n${GREEN}Pathogen has been installed! Plugins plugins can now be easily installed.\n"\ printf "\n${GREEN}Pathogen has been installed! Plugins plugins can now be easily installed.\n"\
"Clone any plugin repositories into /home/kansible/.vim/bundles${NORMAL}\n" "Clone any plugin repositories into /usr/share/vim/vimfiles/bundles${NORMAL}\n"
# Remove any plugins managed by this config tool (Klips) # Remove any plugins managed by this config tool (Klips)
printf "\n${RED}Removing plugins installed by this tool...${NORMAL}\n" printf "\n${RED}Removing plugins installed by this tool...${NORMAL}\n"
sudo rm -R /home/kansible/.vim/bundle/* sudo rm -R /usr/share/vim/vimfiles/bundle/*
# Clone plugin repos into pathogen plugin directory # Clone plugin repos into pathogen plugin directory
printf "\n${GREEN}Installing updated plugins...${NORMAL}\n" printf "\n${GREEN}Installing updated plugins...${NORMAL}\n"
git clone https://github.com/ervandew/supertab /home/kansible/.vim/bundle/supertab && \ git clone https://github.com/ervandew/supertab /usr/share/vim/vimfiles/bundle/supertab && \
printf "\n${GREEN}Supertab plugin has been installed${NORMAL}\n\n" && \ printf "\n${GREEN}Supertab plugin has been installed${NORMAL}\n\n" && \
git clone https://github.com/xavierd/clang_complete /home/kansible/.vim/bundle/clang_complete && \ git clone https://github.com/xavierd/clang_complete /usr/share/vim/vimfiles/bundle/clang_complete && \
printf "\n${GREEN}Clang Completion plugin has been installed${NORMAL}\n\n" printf "\n${GREEN}Clang Completion plugin has been installed${NORMAL}\n\n"
vimConf=( "\n${UNDERLINE}Vim has been configured with the Klips repository.${NORMAL}" \ vimConf=( "\n${UNDERLINE}Vim has been configured with the Klips repository.${NORMAL}" \
"\nConfiguration Changes: " ) "\nConfiguration Changes: " )