dotfiles/.zshrc

128 lines
2.0 KiB
Bash

export ZSH=$HOME/.oh-my-zsh
ZSH_THEME="shadowfacts"
plugins=(osx git)
source $ZSH/oh-my-zsh.sh
# Use Homebrew bin before defaults
export PATH="/usr/local/bin:$PATH"
# Use ~/bin
export PATH="/Users/shadowfacts/bin:$PATH"
# command line tools
alias fuck='$(thefuck $(fc -ln -1))'
alias subl="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
alias python=python3
alias pip=pip3
# alias oldruby="/usr/bin/ruby"
# alias ruby="/usr/local/opt/ruby/bin/ruby"
# Erlang/Elixir persistent shell history
export ERL_AFLAGS="-kernel shell_history enabled"
# lazily load nvm
# export NVM_DIR=~/.nvm
# . $(brew --prefix nvm)/nvm.sh
# nvm() {
# unset -f nvm
# unset -f node
# unset -f npm
# unset -f yarn
# . $(brew --prefix nvm)/nvm.sh
# nvm "$@"
# }
# node() {
# unset -f nvm
# unset -f node
# unset -f npm
# unset -f yarn
# . $(brew --prefix nvm)/nvm.sh
# node "$@"
# }
# npm() {
# unset -f nvm
# unset -f node
# unset -f npm
# unset -f yarn
# . $(brew --prefix nvm)/nvm.sh
# npm "$@"
# }
# yarn() {
# unset -f nvm
# unset -f node
# unset -f npm
# unset -f yarn
# . $(brew --prefix nvm)/nvm.sh
# yarn "$@"
# }
export NODE_OPTIONS="--max-old-space-size=8000"
# Ruby
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
# Go up N directories
up() {
str=""
count=0
while [ "$count" -lt "$1" ];
do
str=$str"../"
let count=count+1
done
cd $str"$2"
}
# Git helper functions
psh() {
branch=`git branch 2> /dev/null | grep \* | awk '{print $2}'`
git push origin $branch "$@"
}
pll() {
branch=`git branch 2> /dev/null | grep \* | awk '{print $2}'`
git pull origin $branch "$@"
}
a() {
git add "$@"
}
s() {
git status
}
c() {
git commit "$@"
}
ca() {
git commit --amend "$@"
}
# pbedit: interactively edit the contents of the clipboard
pbedit() {
tmpfile=`mktemp /tmp/pbedit.XXXXX`
pbpaste > $tmpfile
if vim -c "set nofixeol" $tmpfile ; then
pbcopy < $tmpfile
fi
rm $tmpfile
}
# default file openings
alias -s ipr=open
alias -s xcodeproj=open
alias -s xcworkspace=open