ctrlp.vim icon indicating copy to clipboard operation
ctrlp.vim copied to clipboard

Fuzzy match differently when I include a slash

Open Flimm opened this issue 11 years ago • 2 comments
trafficstars

I have not seen the algorithm used to fuzzy match filenames, but here's a description of how I think it works currently:

  • For the search term abc, search for files matching the regular expression a.*b.*c.

I would like it to work like this:

  • If the search term does not contain a slash, for the search term abxcd, search for files matching the regular expression a.*b.*x.*c.*d.
  • If the search term does contain a slash, for the search term ab/cd, search for files matching the regular expression a[^/]*b.*/.*c[^/]*d.

If for example, I search for food/cake, I do not want it to match food/custard/kebab, but I do want it to match food/sweets/caaake.

The fact that I've included a slash means I no longer want CtrlP to fuzzy match across slash boundaries, but I still want CtrlP to fuzzy match inside slash boundaries. Does that make sense?

Flimm avatar Apr 04 '14 13:04 Flimm

I think this is a brilliant addition, and would help with my current directory searching. :+1:

jridgewell avatar Feb 10 '15 21:02 jridgewell

My Vimscript skills are limited, but if someone with good knowledge of CtrlP could point in the right direction, I might try to implement it (please do not wait for me though, it might take ages)

christianrondeau avatar Oct 03 '16 14:10 christianrondeau