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"
This commit is contained in:
aartoni 2025-03-15 09:52:20 +01:00
parent 83989b98a3
commit cacfc704f2

View File

@ -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.