Merge 7db5655bf8f5dbf9dd5924d4ff293e0912f012a6 into f853f1884a8f0c244765192dc6f5a910a7e2b8e5

This commit is contained in:
Rokosun 2025-04-12 11:02:08 +03:00 committed by GitHub
commit 4ebbce84b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -150,9 +150,22 @@ cmd bulkrename ${{
lf -remote "send $id unselect"
}}
cmd shortcutjump ${{
set -f
clear; tput cup $(($(tput lines)/3))
tmp="$(mktemp)" && trap 'rm "$tmp"' EXIT || exit
sed 's/\s*#.*//; /^$/d' "${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs" > "$tmp"
choice=$(cat "$tmp" | fzf --layout=reverse --height 40% --listen --no-ignore-case --tiebreak=begin,chunk -n1 \
--bind result:transform:"grep -q '^{q}\s' \"$tmp\" && [ \$(grep '^{q}\S*\s' \"$tmp\" | wc -l) -eq 1 ] && echo accept" | \
sed 's/\S\+\s\+//')
[ -z "$choice" ] && exit
path=$(eval printf '%s' \"$choice\")
lf -remote "send $id cd $path"
}}
# Bindings
map <c-f> $lf -remote "send $id select \"$(fzf)\""
map J $lf -remote "send $id cd $(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf)"
map J shortcutjump
map H cd ~
map g top
map D delete