Skip to content

Instantly share code, notes, and snippets.

@prostko
Last active April 26, 2023 19:02
Show Gist options
  • Save prostko/6e08449653950c7a03b1afb5d1bc6018 to your computer and use it in GitHub Desktop.
Save prostko/6e08449653950c7a03b1afb5d1bc6018 to your computer and use it in GitHub Desktop.
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/ericprostko/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="robbyrussell"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to automatically update without prompting.
# DISABLE_UPDATE_PROMPT="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# Caution: this setting can cause issues with multiline prompts (zsh 5.7.1 and newer seem to work)
# See https://github.com/ohmyzsh/ohmyzsh/issues/5765
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
# NVM bash completion
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"
ZSH_THEME="powerlevel10k/powerlevel10k"
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
alias aptible_login="open \"http://dashboard.aptible.com/sso/dorsata\""
autoload -Uz compinit && compinit
# Git aware prompt
setopt prompt_subst
autoload -Uz vcs_info
zstyle ':vcs_info:*' stagedstr 'M'
zstyle ':vcs_info:*' unstagedstr 'M'
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' actionformats '%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
zstyle ':vcs_info:*' formats \
'%F{5}[%F{2}%b%F{5}] %F{2}%c%F{3}%u%f'
zstyle ':vcs_info:git*+set-message:*' hooks git-untracked
zstyle ':vcs_info:*' enable git
+vi-git-untracked() {
if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' ]] && \
[[ $(git ls-files --other --directory --exclude-standard | sed q | wc -l | tr -d ' ') == 1 ]] ; then
hook_com[unstaged]+='%F{1}??%f'
fi
}
precmd () { vcs_info }
PROMPT='%F{5}[%F{2}%n%F{5}] %F{3}%3~ ${vcs_info_msg_0_} %f% $ '
# GIT
alias clone="git clone" # clone git repo
alias gb="git branch --sort=-committerdate" # branch current repo to branch name
alias gco="git checkout"
alias gcob="git checkout -b"
alias gcod="git checkout develop"
alias gf="git fetch"
alias gfs="gf && gs"
alias gl="git log --graph --pretty=format:'%C(yellow)%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative --oneline --decorate"
alias glo="git log --pretty=oneline --abbrev-commit --decorate"
alias gmd="git merge develop"
alias gmf="git merge --ff-only"
alias gmm="git merge"
alias gs="git status"
alias gwp="git whatchanged -p"
alias gpo="git push origin"
# Git - streamline reviewing the changes
alias dif="git diff --name-only | sed -n 1p | xargs git diff"
alias difa="git diff --name-only | sed -n 1p | xargs git add"
alias difco="git diff --name-only | sed -n 1p | xargs git co --"
alias rdiff="git diff --name-only prerelease | grep .rb | xargs bundle exec rubocop --force-exclusion"
alias rdiff="git diff --staged --name-only --diff-filter=d | xargs /Users/ericprostko/code/acog-prenatal-record/bin/rubocop --force-exclusion --format simple -A"
export function gcmm () {
fullbranchname="${$(git rev-parse --abbrev-ref HEAD):0:8}";
git commit -m "$fullbranchname $*";
}
# General Aliases
alias be="bundle exec"
alias ll="ls -laG"
alias path="echo "${PATH}" | tr : '\n'"
alias clr="clear && printf '\e[3J'"
# Dorsata ACOG specific stuff
# Kick off the Foreman, spins upeverything in a single tab
alias serve_foreman="bin/foreman start -f Procfile.local"
alias serve_rails="bin/puma -b 'ssl://localhost:5000?key=./certs/localhost.key&cert=./certs/localhost.crt' -C ./config/puma.rb"
# In order to see the exension run correctly, we need to close chrome entirely, then start a new instance with this command, and run the dev stuff in that window
alias devchrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-features=SameSiteByDefaultCookies,CookiesWithoutSameSiteMustBeSecure"
# Opens an ssh tunnel into the remote server, so I can dev on NextGen stuff
alias devnextgen="ssh -F ~/.ssh/ssh-config-rdp tdsbastion"
# fix stupid mac bug
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
# Open all the ACOG dorsata stuff in separate tabs
alias serve="bash /Users/ericprostko/.development_helper_scripts/dorsata_acog_servers.sh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment