Skip to content

Instantly share code, notes, and snippets.

@mbramson
Created October 22, 2018 00:43
Show Gist options
  • Save mbramson/5f94ccb9b323cd2b4b860d6221df76f8 to your computer and use it in GitHub Desktop.
Save mbramson/5f94ccb9b323cd2b4b860d6221df76f8 to your computer and use it in GitHub Desktop.
# Path to your oh-my-zsh installation.
export ZSH=/Users/mbramson/.oh-my-zsh
[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# 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 change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# 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.
# 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.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# 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? (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)
# User configuration
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin"
# export MANPATH="/usr/local/man:$MANPATH"
source $ZSH/oh-my-zsh.sh
# Set vim mode
bindkey -v
# Fix the default vim mode backspace behavior which is silly and makes the
# world a worse place.
bindkey "^?" backward-delete-char
# 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"
# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"
# 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"
source ~/.profile
source ~/.api
export LOCAL_DEVELOPMENT="true"
# fzf config
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
alias cdgems="cd vendor/bundle/ruby/gems"
alias gop="cd ~/projects"
alias goex="cd ~/projects/exercism"
alias ll="exa -alh"
alias llt="exa -T"
alias vssh="cd ~/vagrant; vagrant ssh"
alias rctags="ctags -R -f ./tags ."
alias pg_start="pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start"
alias pg_stop="pg_ctl -D /usr/local/var/postgres stop -m fast"
alias pg_restart="pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log restart"
alias perf-jmeter="jmeter -t applications/dashboard/epa-realistic-load.jmx"
alias perf-n="jmeter -t applications/dashboard/epa-realistic-load.jmx -n"
alias be="bundle exec"
alias ber="bundle exec rspec"
alias beru="bundle exec rubocop"
alias dc="docker-compose"
function sacrifice_goat() {
sudo killall -HUP mDNSResponder
}
alias bi='bundle _1.10.6_ install'
alias bu='bundle _1.10.6_ update'
alias mt='mix test'
alias vimp="vim -p *"
alias vimrc="vim ~/.vimrc"
alias zshrc="vim ~/.zshrc"
alias szshrc="source ~/.zshrc"
eval "$(rbenv init -)"
# Import all custom scripts. Courtesy of Alan.
if [ -d "$HOME/bin/scripts" ] ; then
export PATH="$HOME/bin/scripts:$PATH"
fi
# load up asdf
. ~/.asdf/asdf.sh
# open the first found router in vim
routes () {
if [ "$(fd routes.rb | head -1 | grep -c '')" -ge 1 ]; then
vim "$(fd routes.rb | head -1)"
elif [ "$(fd router.ex | head -1 | grep -c '')" -ge 1 ]; then
vim "$(fd router.ex | head -1)"
elif [ "$(fd -p router/index.js | head -1 | grep -c '')" -ge 1 ]; then
vim "$(fd -p router/index.js | head -1)"
else
echo "no router found"
fi
}
controllers () {
if [ "$(fd -p controllers -t d | head -1 | grep -c '')" -ge 1 ]; then
vim "$(fd -p controllers -t d | head -1)"
else
echo "no controllers directory found"
fi
}
models () {
if [ "$(fd -p web/models -t d | head -1 | grep -c '')" -ge 1 ]; then
vim "$(fd -p web/models -t d | head -1)"
elif [ "$(fd -p models -t d | head -1 | grep -c '')" -ge 1 ]; then
vim "$(fd -p models -t d | head -1)"
else
echo "no models directory found"
fi
}
views () {
if [ "$(fd -p web/views -t d | head -1 | grep -c '')" -ge 1 ]; then
vim "$(fd -p web/views -t d | head -1)"
elif [ "$(fd -p views -t d | head -1 | grep -c '')" -ge 1 ]; then
vim "$(fd -p views -t d | head -1)"
else
echo "no views directory found"
fi
}
request () {
if [ "$(fd -p /request.rb | head -1 | grep -c '')" -ge 1 ]; then
vim "$(fd -p /request.rb | head -1)"
elif [ "$(fd -p /request_spec.rb | head -1 | grep -c '')" -ge 1 ]; then
vim "$(fd -p /request_spec.rb | head -1)"
else
echo "no request model found"
fi
}
web () {
if [ "$(fd -p _web -t d | head -1 | grep -c '')" -ge 1 ]; then
vim "$(fd -p _web -t d | head -1)"
else
echo "no web directory found"
fi
}
migrations () {
if [ "$(fd -p migrations -t d | head -1 | grep -c '')" -ge 1 ]; then
vim "$(fd -p migrations -t d | head -1)"
else
echo "no migrations directory found"
fi
}
alias request_state="vim ~/vagrant/code/epamotron/app/models/request_state.rb"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment