vim-fuzzysearch icon indicating copy to clipboard operation
vim-fuzzysearch copied to clipboard

Limit length of result

Open axeldetlofsson opened this issue 4 years ago • 2 comments

Hi! Im not good at regex, how do I limit the length of the result? Make the result not longer than 3 of 4 chars of my input.

Ex. I dont want to match 'Fr' with 'Fo foo The rep', only results that is shorter that 'Fr' (2 chars) + example 3 chars, in total 5 chars. Only matching words like 'Fostr' at a maximum.

Thanks for a great plugin!

axeldetlofsson avatar Mar 04 '21 17:03 axeldetlofsson

Not sure i understand, but either way I don't think it has much to do with this plugin? Fuzzysearch doesn't let you use regex, and is meant as a very quick way to search inexactly, while not needing to write a complex query. It does this by generating a regex behind the scenes of course, but there is no functionality for escaping and also adding custom regex. For more specific searches, using the normal searach is better, and then I recommend :h pattern-multi-items for your use case.

ggVGc avatar Mar 04 '21 20:03 ggVGc

Thanks for your fast response and good suggestions! I found an other way of altering the sensitivity (which was my main issue). Take a look at my PR if it something worth implementing.

axeldetlofsson avatar Mar 04 '21 21:03 axeldetlofsson