fix + yazi

This commit is contained in:
2026-01-27 21:38:38 +01:00
parent 97e7fff4e3
commit accc75ce99

17
.zshrc
View File

@@ -88,14 +88,14 @@ zinit ice as"command" from"gh-r" \
atpull"%atclone" src"init.zsh" atpull"%atclone" src"init.zsh"
zinit light starship/starship zinit light starship/starship
# async dotfiles pull (once/day, after prompt) # async dotfiles pull (once/day)
zinit ice wait'1' silent nocompile atload' {
sleep 1
local marker=~/.cache/.dotfiles-pull local marker=~/.cache/.dotfiles-pull
[[ -f $marker && $(($(date +%s) - $(stat -c %Y $marker))) -lt 86400 ]] && return [[ -f $marker && $(($(date +%s) - $(stat -c %Y $marker))) -lt 86400 ]] && return
mkdir -p ~/.cache && touch $marker mkdir -p ~/.cache && touch $marker
git --git-dir=$HOME/.dotgit/ --work-tree=$HOME pull --ff-only -q 2>/dev/null git --git-dir=$HOME/.dotgit/ --work-tree=$HOME pull --ff-only -q 2>/dev/null
' } &!
zinit light zdharma-continuum/null
# paths # paths
typeset -U path typeset -U path
@@ -138,6 +138,15 @@ alias tmuxr="tmux new-session -A -s auto"
alias tmuxn="tmux new-session -A -s auto \; new-window" alias tmuxn="tmux new-session -A -s auto \; new-window"
alias tmuxa="tmux new-session -A -s" alias tmuxa="tmux new-session -A -s"
# yazi wrapper (cd to dir on exit)
function y() {
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd
command yazi "$@" --cwd-file="$tmp"
IFS= read -r -d '' cwd < "$tmp"
[ "$cwd" != "$PWD" ] && [ -d "$cwd" ] && builtin cd -- "$cwd"
rm -f -- "$tmp"
}
# aliases: misc # aliases: misc
alias zshreload="exec zsh" alias zshreload="exec zsh"
alias -g LATEST='*(om[1])' # glob: most recently modified alias -g LATEST='*(om[1])' # glob: most recently modified