#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>

autoload binary_exists

function init-rc-aliases
{
    alias j='jobs'
    alias h='history'
    alias df='df -h'
    alias du='du -h'
    alias e='emacs'
    alias v='vi'

    alias chux='chmod u+x'
    alias chuw='chmod u+w'
    alias chur='chmod u+r'
    alias cho="chown $USER"

    alias today='date +%Y-%m-%d'
    alias addkey="ssh-agent ~/.ssh/id_rsa"

    alias gp='g p origin $gitbranch'
    alias gpf='g p -f origin $gitbranch'
    alias bx='bundle exec'

    binary_exists ledger && alias l='ledger'
    binary_exists gpg2 && alias gpg='gpg2'

    alias -s c='vim'
    alias -s tex='vim'
    alias -s txt='vim'
    alias -s xml='vim'
    alias -s jar='java -jar'
}

init-rc-aliases "$@"
