Closed sitaktif closed 2 months ago
See 2665580120ba1c408016d2b542af9a4229e627ad
I figured adding $FZF_POS
variable and using transform
action to implement the desired behavior would be much more flexible and versatile than adding dedicated actions.
# Toggle selection to the top or to the bottom
seq 30 | fzf --multi --bind 'load:pos(10)' \
--bind 'shift-up:transform:for _ in $(seq $FZF_POS $FZF_MATCH_COUNT); do echo -n +toggle+up; done' \
--bind 'shift-down:transform:for _ in $(seq 1 $FZF_POS); do echo -n +toggle+down; done'
You can replace toggle+up
with select+up
or deselect+up
, etc.
Nice, also TIL about transform
. Cool stuff, thanks!
Checklist
man fzf
)Output of
fzf --version
0.46.1 (brew)
Problem / Steps to reproduce
It would be great to have "toogle to top" and "toggle to bottom" actions.
Current workaround is to keep the
tab
key pressed totoggle+down
to the bottom, but the problem is that the last item will keep toggling very quickly and there's a 50% chance for the last item to be selected upon releasing thetab
key.Having a
toggle+to+bottom
action would allow users to bind a key (sayshift-end
) and toggle all the items from the current cursor position to the last item:1/ Move the cursor to a specific location.
2/ Press the key binding for
toggle+to+bottom
.3/ Desired result: