dotfiles/bash_aliases

60 lines
1.3 KiB
Bash
Raw Normal View History

#!/usr/local/bin/zsh
2017-05-08 18:04:27 +00:00
# Aliases
alias ag='\ag --pager="less"'
2019-02-25 19:42:07 +00:00
alias cat='bat'
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`)"
alias g='git'
2017-05-08 18:04:27 +00:00
alias gp='git push'
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
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 '^\.'; }
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-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
}