chrisant996 / clink-fzf

Fzf integration for Clink
MIT License
77 stars 10 forks source link

FZF sort order for ctrl-r #18

Closed nurpax closed 3 months ago

nurpax commented 3 months ago

I'm trying to set the fzf sort order through a FZF_CTRL_R_OPTS=--sort but somehow the history entries seem to be in more or less random order. I verified that the FZF_CTRL_R_OPTS gets used as if I set it to an invalid value (such as --sortx) Clink complains with unknown option: --sortx.

I'd expect the entries with the largest history index to be at the bottom of the list in the below list. When I locally run fzf without any options on my history file, I see that it in fact sorts the list by default. Somehow the order goes funky when using it with clink-fzf.

image

chrisant996 commented 3 months ago

Your question is about fzf, not about clink-fzf.

https://github.com/junegunn/fzf/wiki/Configuring-shell-key-bindings#sorting-and-exact-matching

"Sorting" in fzf means sorting by relevance, not alphabetical.

You want --no-sort. (Also, --sort is the default, so adding it does nothing.)

nurpax commented 3 months ago

Indeed, that was it! Thanks!