From 92e2da70f0d8231fedced88074ef707b359e8222 Mon Sep 17 00:00:00 2001 From: krolxon Date: Sun, 14 Sep 2025 17:46:37 +0530 Subject: remove yazi, use lf --- .config/zsh/.zshrc | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to '.config/zsh/.zshrc') diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 1970fa9..b810854 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -37,15 +37,6 @@ function zle-keymap-select () { esac } -# Yazi shell wrapper -function y() { - 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" -} - zle -N zle-keymap-select zle-line-init() { zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere) @@ -55,6 +46,19 @@ zle -N zle-line-init echo -ne '\e[5 q' # Use beam shape cursor on startup. preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt. +# +# Use lf to switch directories and bind it to ctrl-o +lfcd () { + tmp="$(mktemp -uq)" + trap 'rm -f $tmp >/dev/null 2>&1' 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 +} +bindkey -s '^o' '^ulfcd\n' + # Edit line in vim with ctrl-e: autoload edit-command-line; zle -N edit-command-line bindkey '^e' edit-command-line -- cgit v1.2.3