aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/home/.config/zsh/.zshrc
diff options
context:
space:
mode:
Diffstat (limited to 'home/.config/zsh/.zshrc')
-rw-r--r--home/.config/zsh/.zshrc9
1 files changed, 9 insertions, 0 deletions
diff --git a/home/.config/zsh/.zshrc b/home/.config/zsh/.zshrc
index d860826..bd03e8b 100644
--- a/home/.config/zsh/.zshrc
+++ b/home/.config/zsh/.zshrc
@@ -221,6 +221,15 @@ alias sysu='systemctl --user'
# Navigation
alias c='clear'
+# Yazi: cd-on-exit wrapper
+y() {
+ local tmp="$(mktemp -t "yazi-cwd.XXXXXX")"
+ command yazi "$@" --cwd-file="$tmp"
+ IFS= read -r -d '' cwd < "$tmp"
+ [[ "$cwd" != "$PWD" ]] && [[ -d "$cwd" ]] && builtin cd -- "$cwd"
+ rm -f -- "$tmp"
+}
+
# Tools
alias stow='stow -R --no-folding --adopt'
alias curl='curlie'