summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChloƩ Vulquin <code@toast.bunkerlabs.net>2026-01-17 15:46:59 +0100
committerChloƩ Vulquin <code@toast.bunkerlabs.net>2026-01-17 15:46:59 +0100
commit6336d739aae5d0a1caf7851dd79697033dfec27d (patch)
tree49c67ea4004687336fd088a324548dab362c8252
parentzsh: init (diff)
zsh: improve grml compat, performance
-rw-r--r--dot_config/zsh/zshenv7
-rw-r--r--dot_config/zsh/zshrc26
-rw-r--r--dot_config/zsh/zshrc.local7
3 files changed, 27 insertions, 13 deletions
diff --git a/dot_config/zsh/zshenv b/dot_config/zsh/zshenv
index 37e010c..c45b643 100644
--- a/dot_config/zsh/zshenv
+++ b/dot_config/zsh/zshenv
@@ -1,8 +1,13 @@
: ${PAGER:=less} ${EDITOR:=vi} \
${HOSTNAME:=$(uname -n)} ${USER:=$(id -un)} \
- ${HISTFILE:=~/.local/state/history/zsh}
+ ${HISTFILE:=~/.local/state/history/zsh} \
+ ${ZDOTDIR:=~/.config/zsh}
export EDITOR HISTFILE PAGER
+NOPATHHELPER=1
+zstyle :grml:completion:compinit arguments -iC
+
path=(~/bin ~/.local/share/sh ~/.local/*/bin /opt/*/bin {/usr,}{/local,}/{s,}bin)
+fpath[1,0]=("$ZDOTDIR"/functions)
[ -r ~/.local/share/sh/xdg ] && source ~/.local/share/sh/xdg
diff --git a/dot_config/zsh/zshrc b/dot_config/zsh/zshrc
index 14ed051..735f661 100644
--- a/dot_config/zsh/zshrc
+++ b/dot_config/zsh/zshrc
@@ -18,38 +18,40 @@ if [ -z "$GRML_OSTYPE" ]; then
done
}
xsource "${ZDOTDIR:-~}/.zshrc.local"
+ autoload compinit
+ compinit -C
fi
+# remove stale: 14 days
+find "${ZDOTDIR:-~}" -name .zcompdump -mtime 14 -exec rm '{}' ';'
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')
+alias l='ls -l' ll='ls -l' la='ls -a' lla='ls -la'
hascmd ugrep && alias grep='ugrep -G -.' xdump='ugrep -X ""'
-hascmd ug && alias uq='ug -Q' ux='ug -UX' uz='ug -z' g='ug -G -.'
+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 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'
-hascmd xh && alias x='xh -b'
+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 .'
+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 hascmd luarocks; then
typeset -T LUA_CPATH=$(luarocks path --lr-cpath) lua_cpath
typeset -T LUA_PATH="$(luarocks path --lr-path);/?.lua" lua_path
diff --git a/dot_config/zsh/zshrc.local b/dot_config/zsh/zshrc.local
new file mode 100644
index 0000000..3c19ce1
--- /dev/null
+++ b/dot_config/zsh/zshrc.local
@@ -0,0 +1,7 @@
+alias mcli=mc
+alias dequarantine='xattr -d com.apple.quarantine'
+
+export EDITOR='emacsclient -c -nw'
+export VISUAL='emacsclient -c'
+
+path[3,0]=(/opt/homebrew/opt/{curl,file-formula,ncurses,ruby,sqlite}/bin)