aboutsummaryrefslogtreecommitdiff
path: root/.config/zsh/.zshrc
diff options
context:
space:
mode:
Diffstat (limited to '.config/zsh/.zshrc')
-rw-r--r--.config/zsh/.zshrc17
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