From 95528f5119f0e973bb0ffb41ed4e17564b39676e Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Sat, 13 Sep 2025 18:18:26 +0900 Subject: updates --- mac/.config/zsh/scripts.zsh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'mac/.config/zsh/scripts.zsh') diff --git a/mac/.config/zsh/scripts.zsh b/mac/.config/zsh/scripts.zsh index 7ebe2ed..a90bca5 100644 --- a/mac/.config/zsh/scripts.zsh +++ b/mac/.config/zsh/scripts.zsh @@ -474,6 +474,7 @@ function lfcd () { fi } + ########################################################################################### ########################################################################################### ### --- MAN --- ### @@ -863,3 +864,18 @@ function delete_venv() { echo "$venv deleted" fi } + + +########################################################################################### +########################################################################################### +### --- YAZI --- ### +# open yazi and cd to the file path +function yazicd () { + tmp="$(mktemp -uq)" + trap 'rm -f $tmp >/dev/null 2>&1 && trap - HUP INT QUIT TERM EXIT' HUP INT QUIT TERM EXIT + yazi --cwd-file="$tmp" "$@" + if [ -f "$tmp" ]; then + dir="$(cat "$tmp")" + [ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir" + fi +} -- cgit v1.2.3