Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ctrl-p can't find my file?

Tags:

vim

ctrlp

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.

like image 365
harris Avatar asked Jul 04 '13 11:07

harris


2 Answers

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.

like image 154
harris Avatar answered Nov 14 '22 09:11

harris


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.

like image 45
Ben Kovitz Avatar answered Nov 14 '22 09:11

Ben Kovitz