diff options
| author | 2026-01-17 13:30:18 +0100 | |
|---|---|---|
| committer | 2026-01-17 13:30:18 +0100 | |
| commit | cc5a8d112b83eaa4477f015fe6007e4057e18da8 (patch) | |
| tree | 1fa732bc20fff76b8eae3fbd86f42e96985aab4a | |
| parent | remove fossil (diff) | |
zsh: init
| -rw-r--r-- | dot_config/zsh/symlink_dot_cache | 1 | ||||
| -rw-r--r-- | dot_config/zsh/symlink_dot_zprofile | 1 | ||||
| -rw-r--r-- | dot_config/zsh/symlink_dot_zshenv | 1 | ||||
| -rw-r--r-- | dot_config/zsh/symlink_dot_zshrc | 1 | ||||
| -rw-r--r-- | dot_config/zsh/symlink_dot_zshrc.local | 1 | ||||
| -rw-r--r-- | dot_config/zsh/symlink_dot_zshrc.post | 1 | ||||
| -rw-r--r-- | dot_config/zsh/symlink_dot_zshrc.pre | 1 | ||||
| -rw-r--r-- | dot_config/zsh/zshenv | 8 | ||||
| -rw-r--r-- | dot_config/zsh/zshrc | 72 |
9 files changed, 87 insertions, 0 deletions
diff --git a/dot_config/zsh/symlink_dot_cache b/dot_config/zsh/symlink_dot_cache new file mode 100644 index 0000000..2516b3e --- /dev/null +++ b/dot_config/zsh/symlink_dot_cache @@ -0,0 +1 @@ +../../.cache diff --git a/dot_config/zsh/symlink_dot_zprofile b/dot_config/zsh/symlink_dot_zprofile new file mode 100644 index 0000000..7f6dfc9 --- /dev/null +++ b/dot_config/zsh/symlink_dot_zprofile @@ -0,0 +1 @@ +zprofile diff --git a/dot_config/zsh/symlink_dot_zshenv b/dot_config/zsh/symlink_dot_zshenv new file mode 100644 index 0000000..69bb87f --- /dev/null +++ b/dot_config/zsh/symlink_dot_zshenv @@ -0,0 +1 @@ +zshenv diff --git a/dot_config/zsh/symlink_dot_zshrc b/dot_config/zsh/symlink_dot_zshrc new file mode 100644 index 0000000..f720807 --- /dev/null +++ b/dot_config/zsh/symlink_dot_zshrc @@ -0,0 +1 @@ +zshrc diff --git a/dot_config/zsh/symlink_dot_zshrc.local b/dot_config/zsh/symlink_dot_zshrc.local new file mode 100644 index 0000000..1dd4a16 --- /dev/null +++ b/dot_config/zsh/symlink_dot_zshrc.local @@ -0,0 +1 @@ +zshrc.local diff --git a/dot_config/zsh/symlink_dot_zshrc.post b/dot_config/zsh/symlink_dot_zshrc.post new file mode 100644 index 0000000..c384032 --- /dev/null +++ b/dot_config/zsh/symlink_dot_zshrc.post @@ -0,0 +1 @@ +zshrc.post diff --git a/dot_config/zsh/symlink_dot_zshrc.pre b/dot_config/zsh/symlink_dot_zshrc.pre new file mode 100644 index 0000000..f7893fb --- /dev/null +++ b/dot_config/zsh/symlink_dot_zshrc.pre @@ -0,0 +1 @@ +zshrc.pre diff --git a/dot_config/zsh/zshenv b/dot_config/zsh/zshenv new file mode 100644 index 0000000..37e010c --- /dev/null +++ b/dot_config/zsh/zshenv @@ -0,0 +1,8 @@ +: ${PAGER:=less} ${EDITOR:=vi} \ + ${HOSTNAME:=$(uname -n)} ${USER:=$(id -un)} \ + ${HISTFILE:=~/.local/state/history/zsh} +export EDITOR HISTFILE PAGER + +path=(~/bin ~/.local/share/sh ~/.local/*/bin /opt/*/bin {/usr,}{/local,}/{s,}bin) + +[ -r ~/.local/share/sh/xdg ] && source ~/.local/share/sh/xdg diff --git a/dot_config/zsh/zshrc b/dot_config/zsh/zshrc new file mode 100644 index 0000000..14ed051 --- /dev/null +++ b/dot_config/zsh/zshrc @@ -0,0 +1,72 @@ +setopt autocd noautopushd nocdablevars +setopt pushdignoredups pushdtohome +setopt globstarshort nullglob rematchpcre +setopt appendhistory histfindnodups histignoredups histignorespace histlexwords +setopt interactivecomments pathdirs printexitvalue rcquotes shortloops +setopt hup +setopt promptpercent transientrprompt +setopt cbases functionargzero multios pipefail + +bindkey -e + +# grml did not run, source zshrc.pre and zshrc.local ourselves +if [ -z "$GRML_OSTYPE" ]; then + xsource() { + local i + for i in "$@"; do + [ -r "$i" ] && source "$i" + done + } + xsource "${ZDOTDIR:-~}/.zshrc.local" +fi + +hascmd() { (( ${+commands[$1]} )) } +# command replacements +hascmd bat && alias cat=bat c='bat -pp' +hascmd bfs && alias find=bfs +hascmd bsdtar && alias tar=bsdtar +hascmd chafa && alias chafa='chafa -f sixel' +hascmd colordiff && alias diff=colordiff dif='colordiff -u' +hascmd jaq && alias jq=jaq +hascmd podman && alias docker=podman +(hascmd eza && alias ls=eza tree='ls -T') || + (hascmd exa && alias ls=exa tree='ls -T') || + (hascmd lsd && alias ls=lsd lh='ls --hyperlink=auto' tree='lh --tree') +hascmd ugrep && alias grep='ugrep -G -.' xdump='ugrep -X ""' +hascmd ug && 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 +hascmd ip && alias ip='ip -c=auto' +alias l='ls -l' ll='ls -l' la='ls -a' lla='ls -la' +hascmd docker || hascmd podman && \ + alias dit='podman run -it --rm' drun='dit -v "$(pwd)":/pwd:Z -w /pwd' +alias ossh='ssh -oStrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=Error' +hascmd xh && alias x='xh -b' + +# program configuration +hascmd ffmpeg && alias ffmpeg='ffmpeg -hide_banner' +hascmd ffprobe && alias ffprobe='ffprobe -hide_banner' +hascmd rg && [ -f ~/.config/ripgrep.conf ] && + export RIPGREP_CONFIG_PATH=~/.config/ripgrep.conf +hascmd sk && export SKIM_DEFAULT_COMMAND='fd -t f || rg --files || find .' +if hascmd luarocks; then + typeset -T LUA_CPATH=$(luarocks path --lr-cpath) lua_cpath + typeset -T LUA_PATH="$(luarocks path --lr-path);/?.lua" lua_path +fi + +t() { + mkdir -p /tmp/t + cd /tmp/t +} +tt() { + local dir=$(mktemp -d) + [ -d "$dir" ] || return 1 + cd "$dir" + trap "rm -rf '$dir'" EXIT +} + +# jump/zoxide/etc should be in zshrc.local or similar + +# source zshrc.post +xsource "${ZDOTDIR:-~}/.zshrc.post" |
