2017-04-27 03:00:30 +00:00
|
|
|
#!/usr/local/bin/zsh
|
2021-02-11 16:25:39 +00:00
|
|
|
export EDITOR=vim
|
2017-05-08 18:04:27 +00:00
|
|
|
# Aliases
|
2016-11-21 15:40:44 +00:00
|
|
|
alias ag='\ag --pager="less"'
|
2019-03-22 19:44:24 +00:00
|
|
|
alias c='\cat'
|
2019-02-25 19:42:07 +00:00
|
|
|
alias cat='bat'
|
2016-11-21 15:40:44 +00:00
|
|
|
alias cg='cd "$(git rev-parse --show-toplevel)"'
|
2017-05-25 04:24:08 +00:00
|
|
|
alias ctags="`brew --prefix`/bin/ctags"
|
2017-05-08 18:04:27 +00:00
|
|
|
alias dots="cd $(dirname `readlink ~/.vim`)"
|
2016-11-21 15:40:44 +00:00
|
|
|
alias g='git'
|
2021-02-11 16:25:39 +00:00
|
|
|
alias gp='git push -u'
|
2016-11-21 15:40:44 +00:00
|
|
|
alias ppjson="python -m json.tool"
|
2017-05-08 18:04:27 +00:00
|
|
|
alias shrug="echo -n '¯\_(ツ)_/¯' | pbcopy"
|
2019-02-25 19:42:07 +00:00
|
|
|
alias httpie="http"
|
2021-02-11 16:25:39 +00:00
|
|
|
alias fuckingip="curl https://wtfismyip.com/json"
|
2017-02-02 19:11:17 +00:00
|
|
|
|
2017-05-08 18:04:27 +00:00
|
|
|
# Functions
|
2017-04-27 03:00:30 +00:00
|
|
|
function cpbr () {
|
|
|
|
if branch=$(git symbolic-ref --short -q HEAD)
|
|
|
|
then
|
|
|
|
printf "$branch" | pbcopy
|
|
|
|
osascript -e "display notification \"$branch copied to clipboard\" with title \"cpbr\""
|
|
|
|
else
|
|
|
|
echo "no branch, can't copy"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
function hidden() { ls -a "$@" | grep '^\.'; }
|
2017-04-27 03:02:08 +00:00
|
|
|
function h () {
|
|
|
|
if [ -z "$*" ]
|
|
|
|
then
|
|
|
|
history
|
|
|
|
else
|
|
|
|
history | egrep "$@"
|
|
|
|
fi
|
|
|
|
}
|
2021-03-30 15:19:06 +00:00
|
|
|
function pulldep() { git pull; bundle; bundle exec rake db:migrate; }
|
2021-02-11 16:25:39 +00:00
|
|
|
|
|
|
|
settitle () {
|
|
|
|
echo -ne "\033]0;"$*"\007"
|
2019-02-25 19:42:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tide() {
|
|
|
|
for var in "$@"
|
|
|
|
do
|
2021-02-11 16:25:39 +00:00
|
|
|
open -a iTerm ~/code/tidelift/$var
|
|
|
|
settitle $var
|
2019-02-25 19:42:07 +00:00
|
|
|
done
|
|
|
|
}
|
2017-04-27 03:02:08 +00:00
|
|
|
|
2017-05-26 14:20:57 +00:00
|
|
|
|
|
|
|
# options
|
2021-03-30 15:19:06 +00:00
|
|
|
#export LESS=-RFX
|
|
|
|
#export PAGER="less"
|
2019-02-25 19:42:07 +00:00
|
|
|
|
|
|
|
pullall (){
|
|
|
|
for d in ./*/ ; do (cd "$d" && pwd && git pull); done
|
|
|
|
}
|
|
|
|
|
|
|
|
new_dock_space (){
|
|
|
|
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'; killall Dock
|
|
|
|
}
|