How to ignore vendor folder in the project root

376 Views Asked by At

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

I have the following in my ctrlp ignore configuration

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 ignore both vendor directories. From the doc's of ctrlp

Note: to ignore a root directory "build", and 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$'
}

This doesn't work and now I see the root vendor folder. The root of ctrlp is correctly setted to the project root (where the vendor I wanna ignore is).

0

There are 0 best solutions below