exclude files/directories when do "Find in Files" and select Directory

I frequently need to search entire big directory trees for text in, say, Python source files.  For example, on my Windows machine, I often search the entirety of my C: or D: drives.  To do this, I select "Find in Files", select Directory, and then specify my drive letter, say D:

But I need a way to tell it to exclude items (files or directories) that match certain patterns.

For example, I usually want to exclude the entire contents of virtual environment subdirectories.  So, I would like to exclude everything that includes *venv* in its path.  Another example is that I may want to only include or always exclude directories that belong to employers & clients, which are scattered across my D: drive.

I am aware that PyCharm lets you define Scopes which have exclude capability.  But this is no good for my use case, because it seems like a Scope is for your current project directory tree.

I need a solution for "Find in Files" and Directory.

Does anyone know how to achieve this?

3

Please sign in to leave a comment.