2

In other editors like sublime, if I search for usermodel it will match the path of models/users.ex, however in CtrlP if I do the same query it will fail. I have to remember to search the path modeluser to make the match.

Is there a way to tweak this so that usermodel or user model would match? I've read the docs and don't see a way but i'm new to it and am not sure if i'm just missing something.

SkinnyG33k
  • 1,721
  • 4
  • 23
  • 30
  • Do you mean you literally put a space in your CtrP query? If yes, don't -- try `usermodel`. – guessimtoolate Nov 05 '15 at 17:33
  • Ah good point. I was doing `modeluser` before and that works but `usermodel` does not. Also spaces as you suggested do not work either way. (edited question to remove spaces) – SkinnyG33k Nov 05 '15 at 19:54
  • I don't think adding a space is an option since a space does not appear in the path at all. CtrP was design to get to files (among other things) as fast as possible and whitespace is usually redundant. Depending on what your file structure looks like you could probably get a match with something like `mous` or even shorter than that. CtrlP gives you instant feedback, so you can stop typing right after you get a match. Anyways that's how I think it was meant to be used. – guessimtoolate Nov 05 '15 at 20:03

2 Answers2

1

AFAIK CtrlP can't do it but you can try writing your custom matcher (see an example here).

There is also Unite with similar functionality which allows to separate multiple patterns with space to narrow down the candidates. This way user model will match anything containing these two words in any order.

0

I ended up switching to emacs (spacemacs) with evil mode (gasp) for the improved Elixir support and i'm able to fuzzy search out of order with Helm.

SkinnyG33k
  • 1,721
  • 4
  • 23
  • 30