fzf
fzf copied to clipboard
Jump over empty lines
- [x] I have read through the manual page (
man fzf
) - [x] I have the latest version of fzf
- [x] I have searched through the existing issues
Info
- OS
- [x] Linux
- [ ] Mac OS X
- [ ] Windows
- [ ] Etc.
- Shell
- [x] bash
- [ ] zsh
- [ ] fish
Problem / Steps to reproduce
Is there a way to make fzf selection mark jump over empty lines in --phony
/ --disabled
mode? So that in the following script the selection goes down from Help
right to Quit
bypassing the empty line?
fzf --phony --prompt='' --reverse --no-info \
--bind=change:clear-query <<EOF
File
Edit
Settings
Help
Quit
EOF
I need this (if possible) to visually separate items into groups.
This could be very useful generally, not just in --phony mode
# Since 0.46.0
# Move cursor past the empty line
echo -e "1. Hello\n2. Goodbye\n\n3. Exit" |
fzf --height '~100%' --reverse --header 'Select one' \
--bind 'enter:transform:[[ -n {} ]] && echo accept || echo "change-header:Invalid selection"' \
--bind 'focus:transform:[[ -n {} ]] && exit; [[ $FZF_ACTION =~ up$ ]] && echo up || echo down'