Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ctrl-P excludes folders #313

Closed
MattNguyen opened this issue Nov 5, 2012 · 8 comments
Closed

Ctrl-P excludes folders #313

MattNguyen opened this issue Nov 5, 2012 · 8 comments
Labels

Comments

@MattNguyen
Copy link

When I run ctrl-p in my Rails projects, ctrl-p completely ignores my apps and specs folder. I've cleared my cache, but to no avail. Not sure what other information I should provide to you, so please point me in the right direction.

@d11wtq
Copy link

d11wtq commented Nov 5, 2012

Does your project use multiple git repositories nested inside each other? Are apps and spec in a different git repo, higher up the directory hierarchy to wherever you opened vim?

@kien
Copy link
Owner

kien commented Nov 6, 2012

You probably hit the max_files limit which is set to 10000 files. Try increasing it with the g:ctrlp_max_files option.

@MattNguyen
Copy link
Author

@kien, you nailed it. Thanks a lot. Closing the issue.

So if you hit the max_files limit, what determines the files that will be included/excluded?

@kien
Copy link
Owner

kien commented Nov 6, 2012

There's no other condition. So naturally files that are in deeper directories have higher chance of being excluded.

@MattNguyen
Copy link
Author

So I started running into this problem again and I figured out that the problem was due to ctrlp's ignore settings. I ended up putting the following in my .vimrc:

" Sane Ignore For ctrlp
let g:ctrlp_custom_ignore = {
  \ 'dir':  '\.git$\|\.hg$\|\.svn$\|\.yardoc\|public\/images\|public\/system\|data\|log\|tmp$',
  \ 'file': '\.exe$\|\.so$\|\.dat$'
  \ }

Doing so greatly improved the speed of ctrlp and the availability of files to search.

This was at the advice of an HN Post.

@rizzatti
Copy link

You might enjoy searching for "git ls-files" inside :help ctrlp. It can use only the files known by git, hg, ...
g:ctrlp_user_command would be the option I think.

@Supernats
Copy link

@rizzatti I should have read that section long ago. Such a wonderful tip. Thanks!

@savroff
Copy link

savroff commented Aug 5, 2016

@rizzatti you just saved my ass 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants