Ctrlp provides a way to ignore some files or folders:

" ctrlp configuraation
let g:ctrlp_custom_ignore = {
   \ 'dir': '\v[\/](\.git|\.sql|\.hg|\.svn|vendor|var|sass|bin|app|web)$',
   \ 'file': '\v\.(exe|so|dll)$',
   \ 'doc': '\v\.(md|rst)$',
   \ }

As you can see, there is a vendor folder in my ignore list. I usually keep it out from ctrlp because makes it really slow down the plugin.

Nonetheless, I need to add just two or three folders contained in the vendor one. Can I configure ctrlp to exclude all folders inside vendor, but accept (for example) Symfony and Doctrine?

  • I've not found anything related to that, so here's an alternate idea. If you use a git repository, you can configure the .gitignore file to do that. – nobe4 Jan 12 '17 at 13:14
  • But I need ctrlp configuration issue, ... what does git configuration can help??? – sensorario Jan 12 '17 at 13:32
  • You can use git's file searcher as your ctrlp command. Thus, this will take the gitignore into account. – nobe4 Jan 12 '17 at 14:00
  • But I do not want that ctrlp ignore all git's ignored files. For example, I need that ctrlp indexes also vendor folder, but only few folders inside it. – sensorario Jan 12 '17 at 17:39
  • Yes, but as I said previously, I don't think it's possible with just ctrlp (but I may be wrong), I'm just suggesting another way to do this which should work. – nobe4 Jan 13 '17 at 7:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.