ctrlp.vim
ctrlp.vim copied to clipboard
Fuzzy match differently when I include a slash
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 expressiona.*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 expressiona.*b.*x.*c.*d. - If the search term does contain a slash, for the search term
ab/cd, search for files matching the regular expressiona[^/]*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?
I think this is a brilliant addition, and would help with my current directory searching. :+1:
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)