fzf icon indicating copy to clipboard operation
fzf copied to clipboard

Jump over empty lines

Open slowpeek opened this issue 3 years ago • 1 comments

  • [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.

slowpeek avatar Aug 20 '21 20:08 slowpeek

This could be very useful generally, not just in --phony mode

sturob avatar Jun 11 '23 03:06 sturob

# 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'

junegunn avatar Jul 03 '24 05:07 junegunn