summaryrefslogtreecommitdiff
path: root/ar/.config/zsh/scripts.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'ar/.config/zsh/scripts.zsh')
-rw-r--r--ar/.config/zsh/scripts.zsh13
1 files changed, 13 insertions, 0 deletions
diff --git a/ar/.config/zsh/scripts.zsh b/ar/.config/zsh/scripts.zsh
index e3364e8..92e10c6 100644
--- a/ar/.config/zsh/scripts.zsh
+++ b/ar/.config/zsh/scripts.zsh
@@ -865,3 +865,16 @@ function delete_venv() {
echo "$venv deleted"
fi
}
+
+
+###########################################################################################
+###########################################################################################
+### --- YAZI --- ###
+# open yazi and cd to the file path
+function yazicd() {
+ local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd
+ yazi "$@" --cwd-file="$tmp"
+ IFS= read -r -d '' cwd < "$tmp"
+ [ -n "$cwd" ] && [ "$cwd" != "$PWD" ] && builtin cd -- "$cwd"
+ rm -f -- "$tmp"
+}