summaryrefslogtreecommitdiff
path: root/mac/.config/zsh
diff options
context:
space:
mode:
Diffstat (limited to 'mac/.config/zsh')
-rw-r--r--mac/.config/zsh/keymaps.zsh4
-rw-r--r--mac/.config/zsh/scripts.zsh16
2 files changed, 18 insertions, 2 deletions
diff --git a/mac/.config/zsh/keymaps.zsh b/mac/.config/zsh/keymaps.zsh
index b911502..698104e 100644
--- a/mac/.config/zsh/keymaps.zsh
+++ b/mac/.config/zsh/keymaps.zsh
@@ -163,13 +163,13 @@ if [[ -f "${ZPLUGINDIR:-${HOME}/.local/bin/zsh}/zsh-vi-mode/zsh-vi-mode.plugin.z
bindkey -s '^B' '^ubc -lq\n'
bindkey -s '^D' '^ucdi\n'
bindkey -s '^F' '^ufzffiles\n'
- bindkey -s '^G' '^ulf\n'
+ bindkey -s '^G' '^uyazi\n'
bindkey -s '^N' '^ulastnvim\n'
bindkey -s '^O' '^utmo\n'
bindkey -s '^P' '^ufzfpass\n'
bindkey -s '^Q' '^uhtop\n'
bindkey -s '^T' '^usessionizer\n'
- bindkey -s '^Y' '^ulfcd\n'
+ bindkey -s '^Y' '^uyazicd\n'
bindkey -s '^Z' '^upd\n'
# bindkey -s '^_' '^u\n'
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
+}