Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
add comment

2 Answers 2

up vote 1 down vote accepted

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

Once inside the prompt:

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

Ctrl+R:
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
add comment

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
add comment

Your Answer

 
discard

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.