How to ignore vendor folder in project root

I am using vim + ctrlp and I have a project with multiple vendor folders, one in the root directory (for vendor packages) and another inside resources / views / vendors.

I have the following in my ctrlp ignore config

let g:ctrlp_custom_ignore = {
    \ 'dir':  '\.git$\|\.hg$\|\.svn$\|node_modules$\|vendor$\|smarty$\|static$\|node_modules',
    \ 'file': '\.exe$\|\.so$\|\.dll$\|\.pyc$\|\.png$'
}

      

Of course, this ignores both vendor directories. From the ctrlp doc

Note: ignore the "build" root directory, not any directory with "build" in it, you can root the regex: ^ build $

So, I tried to add ^vendor$

:

let g:ctrlp_custom_ignore = {
    \ 'dir':  '\.git$\|\.hg$\|\.svn$\|node_modules$\|smarty$\|static$\|node_modules\|^vendor$',
    \ 'file': '\.exe$\|\.so$\|\.dll$\|\.pyc$\|\.png$'
}

      

It doesn't work and now I can see the vendor root folder. The ctrlp root is configured correctly for the project root (where is the vendor I want to ignore).

+3


source to share





All Articles