Last active
January 29, 2018 01:35
-
-
Save bejado/2aa8e664e058068b0b5656a1711ba385 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
# Base 16 terminal | |
BASE16_SHELL=$HOME/.config/base16-shell/ | |
[ -n "$PS1" ] && [ -s $BASE16_SHELL/profile_helper.sh ] && eval "$($BASE16_SHELL/profile_helper.sh)" | |
# 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/benjamin.doherty/.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="agnoster" | |
# Use vim | |
export EDITOR=vim | |
# Change default user | |
DEFAULT_USER=benjamin.doherty | |
# 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 history wd vi-mode) | |
source $ZSH/oh-my-zsh.sh | |
# Prevent less from clearing the screen upon quit | |
# Useful for things like git diff | |
# Note: this must go after the "source $ZSH/on-my-zsh.sh" line | |
export LESS="${LESS} -X" | |
# 0 -- vanilla completion (abc => abc) | |
# 1 -- smart case completion (abc => Abc) | |
# 2 -- word flex completion (abc => A-big-Car) | |
# 3 -- full flex completion (abc => ABraCadabra) | |
zstyle ':completion:*' matcher-list '' \ | |
'm:{a-z\-}={A-Z\_}' \ | |
'r:[^[:alpha:]]||[[:alpha:]]=** r:|=* m:{a-z\-}={A-Z\_}' \ | |
'r:|?=** m:{a-z\-}={A-Z\_}' | |
# 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" | |
# 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" | |
alias sl="sync_lens com.looksery.sample" | |
alias notify="osascript -e 'display notification \"Done!\"'" | |
# sync on lens on anroid | |
function sla() { | |
lensDir=$PWD | |
(cd /Users/benjamin.doherty/Repos/Core/Android; ./gradlew pushLensOnSd -Plens="$lensDir") | |
} | |
alias rb="/Users/benjamin.doherty/Repos/ResourceBuilder/ResourceBuilder" | |
alias disablexcodeplugins="mv ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/* ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/backup/" | |
alias enablexcodeplugins="mv ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/backup/* ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/" | |
alias buckfocus="./scripts/buck/focus :Snapchat --skip-xcode" | |
# Git rename files | |
function gitforcerename() { | |
mv $1 _temp | |
git add -A | |
git commit -m "move to temp" | |
mv _temp $2 | |
git add -A | |
git commit --amend -m "Renamed" | |
} | |
# Remove untracked files from Git | |
function ggreen() { | |
# just ls for now until confident it's finding correct files | |
ls $(grt && realpath `gst --porcelain | sed -e 's/\?\? //g' -e 'tx' -e 'd' -e ':x'`) | |
} | |
function render_gif() { | |
local input_file="$1" | |
local output_file="$2" | |
local length="$3" | |
ffmpeg -y -ss 1 -i "$input_file" -vf fps=10,scale=320:-1:flags=lanczos,palettegen palette.png | |
ffmpeg -ss 1 -i "$input_file" -i palette.png -filter_complex "fps=10,scale=320:-1:flags=lanczos[x];[x][1:v]paletteuse" "$output_file" | |
rm palette.png | |
} | |
unalias gfo | |
function gfo { | |
git fetch origin "$1:$1" | |
} | |
function when { | |
command -v "$1" >/dev/null && ls -l `which "$1"` | |
} | |
function newscript { | |
echo "#!/usr/bin/env bash\n\nset -e\n" > "$1" | |
chmod +x "$1" | |
} | |
# FFMPEG helpers | |
function render_difference { | |
ffmpeg -i "$1" -i "$2" \ | |
-filter_complex "blend=all_mode=difference" \ | |
-c:v libx264 -crf 18 -c:a copy "$3" | |
} | |
function video_hash { | |
ffmpeg -loglevel error -i "$1" -map 0:v -f md5 - | |
} | |
alias ql="qlmanage -p" | |
alias gsuirf="git submodule update --init --recursive --force" | |
function fucksophos { | |
ps aux | grep -i sophos | awk '{print $2}' | sudo xargs kill -9 | |
} | |
# Android paths | |
export ANDROID_SDK=/usr/local/share/android-sdk | |
export ANDROID_SDK_HOME=$ANDROID_SDK | |
export ANDROID_HOME=$ANDROID_SDK | |
export ANDROID_NDK=/usr/local/share/android-ndk-r13b | |
export ANDROID_NDK_HOME=$ANDROID_NDK | |
export PATH=$PATH:$ANDROID_SDK_HOME/platform-tools:$ANDROID_NDK_HOME:$ANDROID_SDK_HOME/tools | |
export NVM_DIR="/Users/benjamin.doherty/.nvm" | |
# Loading nvm slows down zsh startup- use an alias instead | |
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm | |
# alias loadnvm=". /usr/local/opt/nvm/nvm.sh" | |
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting | |
# Loading rvm is also slow- use an alias instead | |
# [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* | |
alias loadrvm=". $HOME/.rvm/scripts/rvm" | |
export PATH=$PATH:~/Repos/scripts/bin | |
# Append local bin directory to path | |
export PATH=$HOME/bin:$PATH | |
# Append build products directory to path for easy command line access | |
# export PATH=$PATH:~/Library/Developer/Xcode/DerivedData/Looksery-ewsmojjqaiuaoecqikkjpmqlatvh/Build/Products/Debug | |
export KEYTIMEOUT=1 | |
# Up and Down Arrows to work with vi-mode | |
# start typing + [Up-Arrow] - fuzzy find history forward | |
if [[ "${terminfo[kcuu1]}" != "" ]]; then | |
autoload -U up-line-or-beginning-search | |
zle -N up-line-or-beginning-search | |
bindkey "${terminfo[kcuu1]}" up-line-or-beginning-search | |
bindkey '^K' up-line-or-beginning-search | |
fi | |
# start typing + [Down-Arrow] - fuzzy find history backward | |
if [[ "${terminfo[kcud1]}" != "" ]]; then | |
autoload -U down-line-or-beginning-search | |
zle -N down-line-or-beginning-search | |
bindkey "${terminfo[kcud1]}" down-line-or-beginning-search | |
bindkey '^J' down-line-or-beginning-search | |
fi | |
# The next line updates PATH for the Google Cloud SDK. | |
if [ -f '/Users/benjamin.doherty/google-cloud-sdk/path.zsh.inc' ]; then source '/Users/benjamin.doherty/google-cloud-sdk/path.zsh.inc'; fi | |
# The next line enables shell command completion for gcloud. | |
if [ -f '/Users/benjamin.doherty/google-cloud-sdk/completion.zsh.inc' ]; then source '/Users/benjamin.doherty/google-cloud-sdk/completion.zsh.inc'; fi | |
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment