Last active
October 14, 2017 17:26
-
-
Save Rhernandez513/0af35a76eef9eff729cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# All in one script to setup vim extensions and setup bash(kinda) | |
# | |
# By Robert David Hernandez | |
# http://www.github.com/rhernandez513 | |
# | |
apt install exuberant-ctags | |
# Disk Usage Analyzer | |
apt install baobab | |
apt install emacs | |
chown -R "$USER" "$HOME" | |
# STARTDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | |
# Install Source Code Pro fonts (only confirmed to work in Ubuntu | |
curl https://gist.githubusercontent.com/lucasdavila/3875946/raw/1c100cae16a06bef154af0f290d665405b554b3b/install_source_code_pro.sh | sh | |
BUNDLEDIR="$HOME/.vim/bundle" # Do not delete, used later in the script | |
mkdir -p "$HOME/.vim/vimtmp/backup" \ | |
"$HOME/.vim/vimtmp/swp" \ | |
"$HOME/.vim/vimtmp/undo" \ | |
"$HOME/.vim/autoload" \ | |
$BUNDLEDIR | |
# Gist Account | |
GIST="https://gist.githubusercontent.com/Rhernandez513" | |
GITHUB="https://github.com" | |
# Dot files | |
VIMRC=".vimrc" | |
VIMRC_URL="$GIST/dcc2a756261a64dd4085/raw/d6aab4778e8d275b967f8120eb7857aaa49fd22f/vimrc" | |
BASHRC=".bashrc" | |
BASHRC_URL="$GIST/05d8f517d4439f889fe3/raw/0072d1b38f4a6ba7a9cfad9e1af5fcb6473ec812/$BASHRC" | |
INPUTRC=".inputrc" | |
INPUTRC_URL="$GIST/05d8f517d4439f889fe3/raw/0072d1b38f4a6ba7a9cfad9e1af5fcb6473ec812/$INPUTRC" | |
BASH_ALIASES=".bash_aliases" | |
BASH_ALIASES_URL="$GIST/05d8f517d4439f889fe3/raw/0072d1b38f4a6ba7a9cfad9e1af5fcb6473ec812/$BASH_ALIASES" | |
# Vim Package Manager | |
PATHOGEN="$HOME/.vim/autoload/pathogen.vim" | |
PATHOGEN_URL="https://tpo.pe/pathogen.vim" | |
touch $PATHOGEN | |
curl -LSso $PATHOGEN $PATHOGEN_URL | |
# Dircolors solarized | |
DIRCOLORSD="$HOME/.dircolors.d" | |
DIRCOLORSD_URL="https://github.com/seebi/dircolors-solarized.git" | |
rm -rf $DIRCOLORSD | |
rmdir $DIRCOLORSD | |
mkdir -p $DIRCOLORSD | |
git clone $DIRCOLORSD_URL $DIRCOLORSD | |
cp -v "$DIRCOLORSD/dircolors.ansi-dark" "$HOME/.dircolors" | |
## declare an array of names | |
declare -a files=( | |
$VIMRC | |
$BASH_ALIASES | |
$BASHRC | |
$INPUTRC | |
) | |
## declare an array of links | |
declare -a urls=( | |
$VIMRC_URL | |
$BASH_ALIASES_URL | |
$BASHRC_URL | |
$INPUTRC_URL | |
) | |
## now loop through the above arrays | |
for ((i = 0; i < ${#files[@]}; ++i)); do | |
touch "$HOME/${files[i]}" | |
echo "$HOME/${files[i]}" | |
echo "$HOME/${files[i]}" "${urls[i]}" | |
curl -q -LSso "$HOME/${files[i]}" "${urls[i]}" | |
done | |
# add YouCompleteMe somehow | |
## declare an array of names (used for directory names) | |
declare -a names=( | |
"powerline-fonts" | |
"editorconfig-vim" | |
"vim-misc" | |
"vim-easytags" | |
"MatchTag" | |
"syntastic" | |
"vim-syntastic-coffee" | |
"indentLine" | |
"auto-pairs" | |
"vim-airline" | |
"promptline.vim" | |
"vim-bufferline" | |
"vim-gitgutter" | |
"vim-colors-solarized" | |
"supertab" | |
"nerdtree" | |
"nerdtree-git-plugin" | |
"numbers" | |
"vim-sensible" | |
"vim-commentary" | |
"html5.vim" | |
"jquery.vim" | |
"vim-coffee-script" | |
"vim-css3-syntax" | |
"vimtex" | |
) | |
## declare an array of links (appended to $GITHUB) | |
## Powerline/fonts.git has to be in [0] for font install to work | |
declare -a links=( | |
"powerline/fonts.git" | |
"editorconfig/editorconfig-vim.git" | |
"xolox/vim-misc.git" | |
"xolox/vim-easytags.git" | |
"gregsexton/MatchTag.git" | |
"scrooloose/syntastic.git" | |
"vitaly/vim-syntastic-coffee.git" | |
"Yggdroot/indentLine.git" | |
"jiangmiao/auto-pairs.git" | |
"bling/vim-airline.git" | |
"edkolev/promptline.vim.git" | |
"bling/vim-bufferline.git" | |
"airblade/vim-gitgutter.git" | |
"altercation/vim-colors-solarized.git" | |
"ervandew/supertab.git" | |
"scrooloose/nerdtree.git" | |
"Xuyuanp/nerdtree-git-plugin.git" | |
"myusuf3/numbers.vim.git" | |
"tpope/vim-sensible.git" | |
"tpope/vim-commentary.git" | |
"othree/html5.vim.git" | |
"nono/jquery.vim.git" | |
"kchmck/vim-coffee-script.git" | |
"hail2u/vim-css3-syntax.git" | |
"lervag/vimtex.git" | |
) | |
## now loop through the above arrays | |
for ((i = 0; i < ${#links[@]}; ++i)); do | |
# rm -rf "$BUNDLEDIR/${names[i]}" | |
rm -rf "$BUNDLEDIR/${names[i]}" | |
mkdir -p "$BUNDLEDIR/${names[i]}" | |
git clone "$GITHUB/${links[i]}" "$BUNDLEDIR/${names[i]}" | |
# POWERLINE FONTS | |
if [ $i = "0" ]; then | |
if [ -e "$BUNDLEDIR/${names[0]}/install.sh" ]; then | |
source "$BUNDLEDIR/${names[0]}/install.sh" | |
rm -rf "$BUNDLEDIR/${names[0]}" | |
rmdir "$BUNDLEDIR/${names[0]}" | |
fi | |
fi | |
# POWERLINE FONTS | |
done | |
# Add an alias to git to display an imporoved git log | |
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" | |
# Simple push/pull for git branches | |
git config --global push.default simple | |
# auto purge stale branches | |
git config --global fetch.prune true | |
# PROFILE="$HOME/.profile" | |
# if [ -e "$PROFILE" ]; then | |
# echo source "$PROFILE" >> "$HOME/$BASHRC" | |
# fi | |
# EOF | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment