Skip to content

Instantly share code, notes, and snippets.

@superscott
Last active August 18, 2020 05:37
Show Gist options
  • Save superscott/10663c52a2ab5103c86d4e1c61f9ca99 to your computer and use it in GitHub Desktop.
Save superscott/10663c52a2ab5103c86d4e1c61f9ca99 to your computer and use it in GitHub Desktop.
oh-my-zsh files.
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
# If you come from bash you might have to change your $PATH.
#export PATH=$HOME/bin:/usr/local/bin:$PATH
alias echo_path="echo :$PATH | sed 's/:/\'$'\n/g'"
alias brewit="brew update && brew upgrade && brew cleanup"
alias procit="cd /Users/bishop/projects/spidr-platform && foreman start -f Procfile.dev"
alias web="ASSET_PREFIX=/webpack node_modules/.bin/webpack-dev-server --inline --colors --profile"
export PG_USER=bishop
export PG_PASS=""
alias lc="colorls -lart"
export DISABLE_SPRING=true
alias stop_all_docker="docker container ls | awk '{ if (NR!=1) {print $1} }' | xargs docker container stop"
alias delete_all_docker="docker ps -a | awk '{if (NR!=1) {print $1}}' | xargs docker rm"
alias unetstat="sudo lsof -n -i | grep -e LISTEN -e ESTABLISHED -e TCP -e UDP"
alias tnetstat="sudo lsof -n -i | grep -e LISTEN -e ESTABLISHED -e TCP"
alias updatedb="sudo /usr/libexec/locate.updatedb"
alias canary="/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary"
alias chrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"
# Path to your oh-my-zsh installation.
export ZSH=/Users/bishop/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="custom-rkj-repos"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git ruby rails brew gem github rvm sublime sudo yarn vagrant osx bundler
)
source $ZSH/oh-my-zsh.sh
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
source ~/.rvm/scripts/rvm
source ~/.zprofile
export PATH="$PATH:$HOME/.rvm/bin"
export PATH="/usr/local/sbin:$PATH"
# user, rvm/rbenv, full path, and time/date
# on two lines for easier vgrepping
# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888
### /.oh-my-zsh/custom/custom-rkj-repos.zsh-theme
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%}+"
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%}✱"
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}✗"
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}➦"
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%}✂"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[blue]%}✈"
ZSH_THEME_GIT_PROMPT_SHA_BEFORE=" %{$fg[blue]%}"
ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$reset_color%}"
function rbenv_info {
if [ -d ~/.rbenv ]; then
echo "$(rbenv version-name)"
fi
}
function rvm_info {
if [ -d ~/.rvm ]; then
echo "$(~/.rvm/bin/rvm-prompt)"
fi
}
function mygit() {
if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then
ref=$(command git symbolic-ref HEAD 2> /dev/null) || \
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(git_prompt_short_sha)$(git_prompt_status)%{$fg_bold[blue]%}$ZSH_THEME_GIT_PROMPT_SUFFIX "
fi
}
function retcode() {}
# alternate prompt with git & hg
PROMPT=$'%{$fg_bold[blue]%}┌─[%{$fg_bold[green]%}%n%b%{$fg_bold[blue]%}]%{$reset_color%} %{$fg_bold[blue]%}[%b%{$fg[red]%}'\$(rvm_info)$(rbenv_info)$'%{$fg_bold[blue]%}] %{$fg_bold[blue]%}[%{$fg_bold[white]%}%~%{$fg_bold[blue]%}]%{$reset_color%} %{$fg_bold[blue]%}[%b%{$fg[yellow]%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{$fg_bold[blue]%}]
%{$fg_bold[blue]%}└─[%{$fg_bold[magenta]%}%?$(retcode)%{$fg_bold[blue]%}] <$(mygit)>%{$reset_color%} '
PS2=$' \e[0;34m%}%B>%{\e[0m%}%b '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment