#!/bin/bash #set -o vi #bind -m vi-insert "\C-l":clear-screen HISTSIZE= HISTFILESIZE= # set PATH so it includes user's private bin if it exists if [ -d "$HOME/.local/bin" ] ; then PATH="$PATH:$(du "$HOME/.local/bin/" | cut -f2 | tr '\n' ':')" fi source ~/.config/aliasrc parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' } export PS1="\[\033[0;35m\]\u\[\033[0;32m\]@\[\033[0;34m\]\h \[\033[32m\]\W\[\033[33m\]\$(parse_git_branch)\[\033[31m\] \n$\[\033[00m\] " mkcd() { if [ ! -d "$1" ]; then mkdir -p "$1" && cd "$1" elif [ -d "$1" ]; then cd "$1" else echo "Error" fi } # Go up directory structures up() { cd $(printf "%0.0s../" $(seq 1 $1)); } git() { if [[ $@ == "mergetool" ]]; then command git mergetool --no-gui else command git $@ fi } git-prune() { if [[ $@ == "prune" ]]; then command git branch --merged develop | grep -vEw "develop$|master$" | xargs git branch -d else command git branch --merged develop | grep -vEw "develop$|master$" fi } color-diff() { if [ -z ${1+x} ] || [ -z ${2+x} ]; then echo "Usage: color-diff dir1/ dir2/" return fi diff -bur $1 $2 | colordiff | less } export EDITOR='nvim' shopt -s extglob export GIT_AUTHOR_NAME="Tovi Jaeschke-Rogers" export GIT_AUTHOR_EMAIL="tovi.jaeschke-rogers@thirty4.com" export GIT_COMMITTER_NAME="Tovi Jaeschke-Rogers" export GIT_COMMITTER_EMAIL="tovi.jaeschke-rogers@thirty4.com" export NVM_DIR="$HOME/.nvm" [ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm [ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm" eval $(thefuck --alias) test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash" || true [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion [[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh" export LESS='-R' export LESSOPEN='|~/.lessfilter %s' export TMPDIR=/tmp