Skip to content

Instantly share code, notes, and snippets.

@NonLogicalDev
Last active August 29, 2015 14:24
Show Gist options
  • Select an option

  • Save NonLogicalDev/5bb92a48ad80388fbd8c to your computer and use it in GitHub Desktop.

Select an option

Save NonLogicalDev/5bb92a48ad80388fbd8c to your computer and use it in GitHub Desktop.
VimSuperAutoAwesome
#!/bin/bash
################################################--++
# INSTALL: curl -L https://goo.gl/L7y6vD | bash
################################################--++
################################################
# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORT
# ----------------------------------------------
# This script will nuke your vim directory, but
# It will have it backed up to .vim.bak
################################################
main() {
Log0 "Setting up vim" && SetUpVim
Log0 "Further instructions:"
Log1 "1) Fire up vim and type in :PlugInstall"
Log1 " (There will be errors before you do :PlugInstall, thats normal)"
Log1 "2) Restart vim and enjoy =]"
}
SetUpVim() {
Log1 "Backing Up"
ditto ~/.vim ~/.vim.bak
ditto ~/.vimrc ~/.vimrc.bak
Log1 "Deleting Directories"
rm -rf ~/.vim
rm -rf ~/.vimrc
Log1 "Installing Plugin Manager"
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
Log1 "Intalling my vimrc file"
curl -fLo ~/.vim/vimrc --create-dirs \
https://gist.github.com/NonLogicalDev/a8ac2a49c83c517cfdf2/raw
Log1 "Symlinking vimrc to home dirctory"
ln -s ~/.vim/vimrc ~/.vimrc
Log1 "Creating backup directory"
mkdir ~/.vim/backup
}
Log0() {
echo "$(tput setaf 1)>>>>>>>>>>>>> $1 <<<<<<<<<<<<<<<$(tput sgr0)"
}
Log1() {
echo ">>> $(tput setaf 2)$1$(tput sgr0)"
}
define(){ IFS='\n' read -r -d '' ${1} || true; }
main "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment