dotfiles/bash_aliases

63 lines
1.3 KiB
Bash
Raw Normal View History

#!/usr/local/bin/zsh
2021-02-11 16:25:39 +00:00
export EDITOR=vim
2017-05-08 18:04:27 +00:00
# Aliases
alias ag='\ag --pager="less"'
alias c='\cat'
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'
2021-02-11 16:25:39 +00:00
alias gp='git push -u'
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
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
}
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-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
}