Eric Bower
·
2026-10-04
1if test -e "$HOME/.config/yash/base.sh"; then
2 . "$HOME/.config/yash/base.sh"
3fi
4
5if test -e "$HOME/.config/yash/local.sh"; then
6 . "$HOME/.config/yash/local.sh"
7fi
8
9export PATH="$HOME/.local/bin:/usr/local/go/bin:$HOME/.cargo/bin:$HOME/.npm-packages/bin:$HOME/go/bin:$PATH"
10export LANG=en_US.UTF-8
11export EDITOR=kak
12export VISUAL=kak
13export PAGER=less
14export GPG_TTY="$(tty)"
15export XDG_CONFIG_HOME="$HOME/.config"
16export VDIRSYNCER_CONFIG="$HOME/.config/vdirsyncer/config"
17export MDIR="$HOME/mail"
18export PA_LENGTH=20
19export PA_PATTERN="A-Za-z0-9_-"
20export LANG="en_US.UTF-8"
21export LESS="-FRX"
22export YASH_LOADPATH="${XDG_CONFIG_HOME:-$HOME/.config}/yash${YASH_LOADPATH:+:$YASH_LOADPATH}"
23
24alias pushall='git remote | xargs -I R git push R'
25alias sway='XDG_CURRENT_DESKTOP=sway sway'
26alias tre='tree -CF --dirsfirst -L 2'
27alias pp="PA_DIR=$HOME/dev/pico-pass pa"
28alias logs='ssh pipe sub /pico/log-drain -k | jq -r'
29alias ash='autossh -M 0 -q'
30alias mdfmt='uvx --with=mdformat-gfm --with=mdformat-frontmatter --with=mdformat-gfm-alerts mdformat --wrap no'
31
32pw() {
33 tr -dc 'A-Za-z0-9!"#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' </dev/urandom | head -c 20; echo
34}
35
36fcd() {
37 local dir
38 if command -v fd >/dev/null 2>&1; then
39 dir="$(fd --max-depth 3 --type d --hidden --follow --exclude .git --exclude .jj . "${1:-.}" 2>/dev/null | fzf +m)" || return
40 else
41 dir="$(find "${1:-.}" -mindepth 1 -maxdepth 3 -path '*/.*' -prune -o -type d -print 2>/dev/null | fzf +m)" || return
42 fi
43 test -n "$dir" && cd "$dir"
44}
45
46
47_zmx_env_hook() {
48 if test -n "${ZMX_SESSION:-}"; then
49 eval "$(zmx print-env -s .)"
50 fi
51}
52PROMPT_COMMAND="_zmx_env_hook${PROMPT_COMMAND:+; $PROMPT_COMMAND}"
53
54if test -n "${ZMX_SESSION:-}"; then
55 export YASH_PS1="[$ZMX_SESSION] ${YASH_PS1}"
56fi
57
58if command -v zmx >/dev/null 2>&1; then
59 eval "$(zmx completions yash)"
60fi
61
62# kak: filetype=sh