Ctrl-p can't find my file?
Asked Answered
M

2

17

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.

Monocoque answered 4/7, 2013 at 11:51 Comment(2)
CtrlP's issue tracker is that way.Septempartite
Did you updated the CtrlP cache with hitting F5?Infundibuliform
M
35

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.

Monocoque answered 5/7, 2013 at 2:17 Comment(0)
E
10

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.

Ephesus answered 12/2, 2018 at 22:23 Comment(1)
Same context here, your solution works like a charm and is way faster than other ones I saw. Thanks !Assumed

© 2022 - 2024 — McMap. All rights reserved.