fzf icon indicating copy to clipboard operation
fzf copied to clipboard

FZF prompt - Pre-select first option instead of the last

Open snowman opened this issue 2 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
    • [ ] bash
    • [X] zsh
    • [ ] fish

Problem / Steps to reproduce

In the FZF prompt, is there a way to pre-select the first option instead of the last?

Current behavior: image

Desired behavior: image

mirror issue: https://github.com/junegunn/fzf.vim/issues/858

snowman avatar May 19 '22 10:05 snowman

I too would like to do the same. Perhaps either of the two may work:

  1. A new command line option like --initial-match=first,last, where first is the current default.

  2. A new action, similar to change and backward-eof, named on-load that executes whenever the finder reloads data. This way, I could do: --bind=on-load:last or --bind=on-load:first.

salmankhilji avatar Jun 03 '22 13:06 salmankhilji

Any way to do this right now @junegunn ?

edi9999 avatar Oct 15 '22 19:10 edi9999

Using --tac

seq 10 | fzf --tac --layout=reverse --height=~50%
seq 10 | fzf --tac --layout=reverse-list --height=~50%

junegunn avatar Oct 16 '22 07:10 junegunn

Ok thanks !!

This issue can be closed then.

edi9999 avatar Oct 16 '22 08:10 edi9999