# [xdg]
alias abook='abook -C "$XDG_CONFIG_HOME"/abook/abookrc --datafile "$XDG_DATA_HOME"/addressbook.abook'
alias dict='dict -c "$XDG_CONFIG_HOME"/dict/dictrc'
alias startx='startx "$XDG_CONFIG_HOME/X11/xinitrc" vt1'
alias wget='wget --hsts-file="$XDG_CACHE_HOME/wget-hsts"'

# [misc]
# alias doas=sudo
# ssh workflow
alias qc="there \"$XDG_HOME/.ssh/config\" && ssh \"\$(sed -n -e '/\*.*/d' -e '/^Host/s/^Host //p' \"$XDG_HOME/.ssh/*config\" | $FUZZER)\""
# thwart - baseutils_conditioning
multimap sl lls sls lsl lss kls cdd mr

# [ip]
# TODO make this cross-platform
there ifconfig && alias lip="ifconfig | grep -w inet  | cut -d ' ' -f2"
there ip && alias lip="ip route get 1 | sed -n 's/.* src \(.*\) uid .*/\1/p'"
there curl && alias gip="curl ifconfig.co"
there fd || find_() { find . -name "*$**"; } && alias fd=find_

# [navigation]
alias ....='cd ../../..'
alias ...='cd ../..'
alias ..='cd ..'
alias n='cd_and_ls'
alias cf='quickopen "-type d" cd'
alias ff="$EDITOR \"\$(git ls-files | $FUZZER)\""
alias of="quickopen open f"
if [ -n "$BASH" ] || [ -n "$ZSH_VERSION" ]; then __is_bashlike=--; fi
alias $__is_bashlike -='cd -'

# [shorthands]
alias a=attach
alias '?d'='sr duckduckgo'
alias d='download'
alias e="$EDITOR"
alias f="quickopen \"-type f\" $EDITOR"
alias g=git
alias l="\"$FM\" ."
alias le=less
alias m=smartmake
alias x=extract.sh
there rc || alias rc='sudo systemctl'

# [midlonghands]
alias or='open_project ~/repo'
alias orr='open_project ~/resrepo'
alias op='cd "$(open_project "$HOME/repo" | $FUZZER)"'
alias girl='grep -irl'
alias gir='grep -ir'
alias markdown=md2html
alias fy="$FUZZER | clip"
alias o='xdg-open'

alias voom="VIM_PLUGINS_DIR=\"$XDG_DATA_HOME\"/vim/pack/voom/start command voom"
alias nvoom="VIM_PLUGINS_DIR=\"$XDG_DATA_HOME\"/nvim/pack/voom/start VIM_DIR=\"$XDG_CONFIG_HOME\"/nvim command voom"

alias undot="rm \"$XDG_HOME/.git\""
alias dot="ln -s \"$XDG_DATA_HOME/wt/dotfiles.git\" \"$XDG_HOME/.git\""
