garybernhardt / selecta

A fuzzy text selector for files and anything else you need to select. Use it from vim, from the command line, or anywhere you can run a shell command.
MIT License
1.34k stars 81 forks source link

Non-interactive mode? #66

Open v-yarotsky opened 9 years ago

v-yarotsky commented 9 years ago

As far as I understand, selecta currently requires a tty. However, it might also be useful to just have a sort of fuzzy-grep. In my case I have a script which yields a list of urls, and I want to get a list of urls (fuzzy) matching a string ordered by score.

garybernhardt commented 9 years ago

This is the second vote for a non-interactive mode. I think I'm fine with supporting it. The one wrinkle is that I'd like the scoring algorithm to be very stable before supporting this, since behavior should be consistent once people are relying on it in scripts. I still consider the current matching algorithm a simple stop-gap, but Selecta will need to be ported to a much faster language to support the algorithm I really want, so it might be a while before things are stable.

airblade commented 9 years ago

Out of curiosity, would you mind describing the algorithm you really want?

garybernhardt commented 9 years ago

I just described the algorithm and its performance problems in the algorithm issue: https://github.com/garybernhardt/selecta/issues/30#issuecomment-68805975