2017-04-27 03:00:30 +00:00
|
|
|
#!/usr/local/bin/zsh
|
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'
|
2017-05-08 18:04:27 +00:00
|
|
|
alias gp='git push'
|
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"
|
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
|
|
|
|
}
|
2019-02-25 19:42:07 +00:00
|
|
|
settitle() {
|
|
|
|
printf "\033k$1\033\\"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tide() {
|
|
|
|
for var in "$@"
|
|
|
|
do
|
|
|
|
tmux new-window -c "/code/tidelift/$var" -n "$var"
|
|
|
|
printf "\033k$var\033\\"
|
|
|
|
done
|
|
|
|
|
|
|
|
}
|
2017-04-27 03:02:08 +00:00
|
|
|
|
2017-05-26 14:20:57 +00:00
|
|
|
|
|
|
|
# options
|
|
|
|
export LESS=-RFX
|
|
|
|
export PAGER="less"
|
2018-04-05 20:14:03 +00:00
|
|
|
alias love="/Applications/love.app/Contents/MacOS/love"
|
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
|
|
|
|
}
|