Skip to content

Instantly share code, notes, and snippets.

@JorgeFrancoIbanez
Last active October 15, 2020 14:04
Show Gist options
  • Save JorgeFrancoIbanez/f58602879a3ffa350a1fd46940595e57 to your computer and use it in GitHub Desktop.
Save JorgeFrancoIbanez/f58602879a3ffa350a1fd46940595e57 to your computer and use it in GitHub Desktop.
Set up vim themes on bash (Debian/Ubuntu) Usage: chmod +x /path/vim_add_theme.sh | /path/vim_add_theme.sh <name_of theme> <url_raw_color_file>
#!/bin/bash
############## README #######################
# This script will clean your ~/.vimrc #
# If you want to use it ahve that in mind. #
#############################################
### Vim themes ###
## https://www.slant.co/topics/480/~best-vim-color-schemes
##################
## Example ##
# ~/./vim_add_theme.sh nord https://raw.githubusercontent.com/arcticicestudio/nord-vim/develop/colors/nord.vim #
## End Example ##
PACKAGES="wget vim"
for PACKAGE in $PACKAGES; do
REQUIRED_PKG=$PACKAGE
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $REQUIRED_PKG|grep "install ok installed")
echo Checking for $REQUIRED_PKG: $PKG_OK
if [ "" = "$PKG_OK" ]; then
echo "No $REQUIRED_PKG. Setting up $REQUIRED_PKG."
sudo apt-get --yes install $REQUIRED_PKG
fi
done
# eck if colors path exist
[ -d "~/.vim/colors " ] && echo "Directory /path/to/dir exists." || echo "Error: Directory /path/to/dir does not exists." | mkdir -p ~/.vim/colors
cd ~/.vim/colors
wget -O $1.vim $2
echo 'colorscheme' $1 > ~/.vimrc
echo Theme setup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment