exclude directory from search

I frequently do 'Find in Path' to find a string, for example, I wanted to see where my project was using the string 'supertest'. When I do find in path, however, it searches my node_modules folder, which I do not want it to search. I am using meanjs, which puts node_modules right at the root. Is there a way to find a string within a project but exclude one directory path from the search?

5 comments
Comment actions Permalink

Hi there,

Create a custom scope (Settings | Scopes) and exclude unwanted folders/files there.

Now when you do "Find in Path" -- just use that scope

screen01.png

5
Comment actions Permalink

My issue is a little different, I'm doing a refactor, and there are some conf files that must be added as libraries, and when I refactor, intellij does not search on them.

0
Comment actions Permalink

This feels now like renting a Chinese ferrari :(

0
Comment actions Permalink

@lmdbluis

What exactly do you mean by "refactor"? Is it IDE's own refactoring tool .. or you just doing manual find & replace kind of thing?

The thing is: stuff marked as a Library code is considered to be 3rd party code which is not meant to be user edited / touched by IDE's refactoring and alike (but it's there so it can be used for code completion and stuff).

For find & replace -- just point to the project root folder and IDE will do that in all folders, even excluded.

P.S. Some tools though can have Scope selector if invoked via additional shortcut (i.e. Find Usages).

0

Please sign in to leave a comment.