diff options
author | awy <awy@awy.one> | 2025-01-29 16:12:36 +0300 |
---|---|---|
committer | awy <awy@awy.one> | 2025-01-29 16:12:36 +0300 |
commit | f8058f8c39b3058e5c32c198ddc368d858b4cd2e (patch) | |
tree | af735a889b4addf58827555a7aebb1e727fe12d5 /.config | |
parent | 015f2fd07f0f7647d097d02552e652702c48f48a (diff) |
Diffstat (limited to '.config')
-rw-r--r-- | .config/zsh/.zshrc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index b5ebdc8..fbf6d01 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -38,16 +38,15 @@ _comp_options+=(globdots) # Include hidden files. source "/usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh" -lfcd () { - tmp="$(mktemp -uq)" - trap 'rm -f $tmp >/dev/null 2>&1 && trap - HUP INT QUIT TERM PWR EXIT' HUP INT QUIT TERM PWR EXIT - lf -last-dir-path="$tmp" "$@" - if [ -f "$tmp" ]; then - dir="$(cat "$tmp")" - [ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir" - fi +function y() { + local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd + yazi "$@" --cwd-file="$tmp" + if cwd="$(command cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then + builtin cd -- "$cwd" + fi + rm -f -- "$tmp" } -bindkey -s '^o' '^ulfcd\n' +bindkey -s '^o' '^uy\n' unset SSH_AGENT_PID if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then |