Source

dotfiles / bashrc-mac

Full commit
# The next 5 functions are Mac-specific, from http://superuser.com/questions/52483/terminal-tips-and-tricks-for-mac-os-x/160523#160523
pman() {
  man -t $* | ps2pdf - - | open -g -f -a /Applications/Preview.app
}
tman () {
  MANWIDTH=160 MANPAGER='col -bx' man $@ | mate
}
# Quit an OS X application from the command line
quit () {
    for app in $*; do
        osascript -e 'quit app "'$app'"'
    done
}
relaunch () {
    for app in $*; do
        osascript -e 'quit app "'$app'"';
        sleep 2;
        open -a $app
    done
}
zap () {
    open -a AppZapper /Applications/"${1}".app
}


# http://superuser.com/questions/52483/terminal-tips-and-tricks-for-mac-os-x/160808#160808
alias screensaver_background="/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background &"

bman () {
    gunzip < `man -w $@` | groff -Thtml -man | bcat
}

alias excel='open -a "Microsoft Excel" '
alias word='open -a "Microsoft Word" '