16

The following is my ctr-p config:

let g:ctrlp_map = '<Leader>t'
let g:ctrlp_match_window_bottom = 0
let g:ctrlp_match_window_reversed = 0
let g:ctrlp_working_path_mode = 'ra' 
let g:ctrlp_root_markers = ['.ctrlp']
let g:ctrlp_dotfiles = 0                                                                                                                                           
let g:ctrlp_switch_buffer = 0

I put one file .ctrlp in my project root directory.

I typed ,t and ,d to find my full filename "PhotoArtHacker" which's full path is 12083_cmcc_svn4456/mediatek/platform/mt6589/hardware/camera/hal/adapter/oppo/PhotoArtHacker.cpp.

while, I don't know why the file didn't appeared in the search result? Is my file depth too deep?

By the way, the android project contains thousands of files.

harris
  • 1,473
  • 1
  • 17
  • 26

2 Answers2

34

I found a solution on the project's GitHub issues.

It looks that if you set the property:

let g:ctrlp_max_files=0

The problem will be solved.

alex
  • 479,566
  • 201
  • 878
  • 984
harris
  • 1,473
  • 1
  • 17
  • 26
8

I had the same problem: ctrlp+F5 wasn't finding all my source files, because it was searching through too many files in too many subdirectories. I found the following command in the ctrlp help:

let g:ctrlp_user_command =  
  \ ['.git', 'cd %s && git ls-files -co --exclude-standard'] 

This solved the problem without reading a vast number of files (so no slowdown and no need to set g:ctrlp_max_files to 0).

The ctrlp help provides other commands for searching other types of repositories.

Ben Kovitz
  • 4,920
  • 1
  • 22
  • 50
  • 1
    Same context here, your solution works like a charm and is way faster than other ones I saw. Thanks ! – Sumak Aug 30 '22 at 13:40