Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was hoping that I could just type "job.php" and be directed to the job.php in my /lib/model/ folder, but I've mostly just get many other files returned:

[No name]

> batch/dataFixes/jobProspectsSubscriptionId.php
> batch/dataFixes/jobProspectsRankDistance.php
> batch/dataFixes/hiredJobDistanceRankFeedback.php
> batch/sendWeeklyJobOwnersUpdateEmail.php
> batch/dataFixes/backdateJobClosureDailyStats.php
> batch/dataFixes/jobExpectedRevenue.php
> batch/dataFixes/updateJobStats.php
> batch/updateEndedJobState.php
> batch/findUnresponsiveJobPosters.php
> batch/_job_criteria.php

 prt  file  <mru>={ files }=<buf> <->      /Users/shane/Documents/sites/zinc 
>d> job.php_

Switching to 'find in path' mode, and typing lib/model/job.php brings up tonnes of other classes in that folder which have 'job' in the filename, but not job.php.

Job is a pretty common word in our project, but I was hoping that an exact match for the filename would get ranked pretty highly in the results.

Am I using CtrlP wrong, or is the project not really suited to it?

share|improve this question
Maybe cache? Try to type F5 in CtrlP window. – mattn Jan 10 '13 at 2:57
up vote 11 down vote accepted

Easiest way is to toggle to file name only mode and regex mode, from docs:

Once inside the prompt:

Toggle between full-path search and filename only search.
Note: in filename mode, the prompt's base is >d> instead of >>>

Toggle between the string mode and full regexp mode.
Note: in full regexp mode, the prompt's base is r>> instead of >>>

share|improve this answer
To set filename-search as your default search mode, add this to your vimrc: let g:ctrlp_by_filename = 1 – jonS90 Jun 28 at 20:14

Add the following to your ~/.vimrc (you may need to create if it does not exist):

let g:ctrlp_regexp = 1
share|improve this answer

I actually use CtrlP C matching extension ctrlp-cmatcher

Its quite a bit faster, and results are what one would expect (without having to use regex).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.