# vim: ft=zsh xzsource zshrc.pre xzsource zshrc.{options,style} ### Bindings bindkey -e ### Functions, Aliases ## Command replacements [[ -x =bat ]] && alias cat=bat c='bat -pp' [[ -x =bfs ]] && alias find=bfs [[ -x =bsdtar ]] && alias tar=bsdtar [[ -x =colordiff ]] && alias diff=colordiff dif='colordiff -u' [[ -x =jaq ]] && alias jq=jaq [[ -x =podman ]] && alias docker=podman if [[ -x =eza ]] { alias ls=eza tree='ls -T' } elif [[ -x =exa ]] { alias ls=exa tree='ls -T' } elif [[ -x =lsd ]] { alias ls=lsd lh='ls --hyperlink=auto' tree='lh --tree' } alias l='ls -l' ll='ls -l' la='ls -a' lla='ls -la' [[ -x =ugrep ]] && alias grep='ugrep -G -.' xdump='ugrep -X ""' alias uq='ug -Q' ux='ug -UX' uz='ug -z' g='ug -G -.' ## Convenience aliases alias e='emacsclient -c -nw' E='emacsclient -c' m=micro n=nvim alias ip='ip -c=auto' alias dit='docker run -it --rm' drun='dit -v "$(pwd)":/pwd:Z -w /pwd' alias ossh='ssh -oStrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=Error' alias x='xh -b' ## Program configuration alias chafa='chafa -f sixel' alias ffmpeg='ffmpeg -hide_banner' alias ffprobe='ffprobe -hide_banner' [ -f ~/.config/ripgrep.conf ] && export RIPGREP_CONFIG_PATH=~/.config/ripgrep.conf export SKIM_DEFAULT_COMMAND='fd -t f || rg --files || find .' if [[ -x =luarocks ]] { typeset -T LUA_CPATH=$(luarocks path --lr-cpath) lua_cpath typeset -T LUA_PATH="$(luarocks path --lr-path);/?.lua" lua_path } ## Functions t() { mkdir -p /tmp/t cd /tmp/t } tt() { local dir=$(mktemp -d) [ -d "$dir" ] || return 1 cd "$dir" trap "rm -rf '$dir'" EXIT } # you may want to: # set up jump/zoxide/etc # zstyle :completion:*:hosts list of hosts # hash -d short=directory # setup terminal integration / osc0 xzsource zshrc.{local,post} # if compinit hasn't ran, run it now # this way there's at least some minimum compatibility with /etc/zshrc if (( ! ${+_comps} )) { autoload -Uz compinit compinit -i } # if promptinit hasn't ran, run it now, and set a default prompt if (( ! ${+functions[prompt]} )) { autoload -Uz promptinit promptinit prompt fish }