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
vim ctrlp


source to share


No one has answered this question yet

Check out similar questions:

3487
How do I exit the Vim editor?
2307
How do I make Git use the editor of its choice for commits?
1741
How to replace a character with a newline in Vim
1330
How does vim's "write with sudo" trick work?
1214
How to do case insensitive search in Vim
1075
How do I go to the end of a line in Vim?
962
How to efficiently handle multiple files in Vim?
8
CtrlP: ignore files in a subdirectory in a git repository
7
How can I configure ctrlp to work properly with ag outside of a git repository?
1
Vim plugin Ctrlp: ctrlp_root_markers is ignoring the values ​​I set?



All Articles
Loading...
X
Show
Funny
Dev
Pics