dotfiles/.zshrc

128 lines
2.0 KiB
Bash
Raw Permalink Normal View History

export ZSH=$HOME/.oh-my-zsh
2016-07-17 16:18:06 +00:00
2016-07-18 23:38:17 +00:00
ZSH_THEME="shadowfacts"
2016-07-17 16:18:06 +00:00
plugins=(osx git)
source $ZSH/oh-my-zsh.sh
2016-09-17 14:16:14 +00:00
# Use Homebrew bin before defaults
export PATH="/usr/local/bin:$PATH"
2016-07-17 16:25:02 +00:00
2019-07-11 20:25:11 +00:00
# Use ~/bin
export PATH="/Users/shadowfacts/bin:$PATH"
2016-09-17 14:16:14 +00:00
# command line tools
2016-07-17 16:18:06 +00:00
alias fuck='$(thefuck $(fc -ln -1))'
alias subl="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
alias python=python3
alias pip=pip3
2020-12-11 23:39:23 +00:00
# alias oldruby="/usr/bin/ruby"
# alias ruby="/usr/local/opt/ruby/bin/ruby"
2019-07-11 20:25:11 +00:00
# Erlang/Elixir persistent shell history
export ERL_AFLAGS="-kernel shell_history enabled"
2016-07-17 16:18:06 +00:00
2016-07-18 23:15:32 +00:00
# lazily load nvm
2019-07-11 20:25:11 +00:00
# export NVM_DIR=~/.nvm
2020-12-11 23:39:23 +00:00
# . $(brew --prefix nvm)/nvm.sh
2016-07-18 23:15:32 +00:00
2019-07-11 20:25:11 +00:00
# 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 "$@"
# }
2016-07-17 16:25:02 +00:00
2020-12-11 23:39:23 +00:00
export NODE_OPTIONS="--max-old-space-size=8000"
# Ruby
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
2016-09-10 19:47:50 +00:00
# Go up N directories
up() {
str=""
count=0
while [ "$count" -lt "$1" ];
do
str=$str"../"
let count=count+1
done
2016-12-11 19:42:30 +00:00
cd $str"$2"
2016-09-10 19:47:50 +00:00
}
2016-12-17 16:47:17 +00:00
# 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 "$@"
}
2020-12-11 23:39:23 +00:00
# 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
}
2016-07-17 16:25:02 +00:00
# default file openings
alias -s ipr=open
2019-07-11 20:25:11 +00:00
alias -s xcodeproj=open
2019-12-06 23:52:31 +00:00
alias -s xcworkspace=open