From cacfc704f2e5bb98dec1aa4719267ac743872f54 Mon Sep 17 00:00:00 2001 From: aartoni Date: Sat, 15 Mar 2025 09:52:20 +0100 Subject: [PATCH] prevent se from editing the wrong script this happens every time a script is selected and another one matches before it, this happens if you select a script such as "sd" while having another one called "cron/sdo" --- .config/shell/aliasrc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index a09e22b8..e73802dc 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -14,9 +14,10 @@ for command in mount umount sv pacman updatedb su shutdown poweroff reboot ; do done; unset command se() { - s=("${HOME}/.local/bin/"**/*(.)) - c="$(print -lnr ${s:t:r} | fzf)" - [[ "${c}" ]] && "${EDITOR}" ${${(M)s:#*/${c}*}[1]} + local -r bindir=~sc/ + s=("${bindir}"**/*(.)) + c="$(print -lnr ${s/$bindir/} | fzf)" + [[ "${c}" ]] && "${EDITOR}" "$bindir$c" } # Verbosity and settings that you pretty much just always are going to want.