How do I let silver searcher ignore certian sub-directories, in my case I want ag to search md format only and ignore all the node_modules directories, I tried what here silver searcher ignore multiple directories said, but it did not work.
ag --md --ignore-dir={node_modules} foo
I searched the possible solution but found some old issues, e.g, Ignore file in subdirectory not applied properly (opened in 2013) and this New release? opened in 2021
So can this be done ?
There are two answers in the linked Q&A and when I first tried them I did not read the answers carefully, e.g. the highest score one
So
ag --md --ignore-dir={node_modules,} fooworks butag --md --ignore-dir={node_modules} foodoes NOT work. My bad!Or I can just
ag --md --ignore node_modules foo, as here said