PyCharm exclude folders from indexing, find and show usages

PyCharm exclude folders from indexing, find and show usages

One of the best advantages for PyCharm for me are indexing and finding files. I find it much better more productive working with PyCharm in comparison to Eclipse, Sublime, Vim or Atom.

I'm working with PyCharm and IntelliJ(community edition) on daily basis and can share that they save bit amount of time spent in searching. But only if I know what and how to search it. What of the common problems might be how to search.

pycharm_excluded

For example if you search in Python/Java project with build/bin folders, external libraries and unrelated files(data for example) - finally you can end with:

  • duplicated search results
  • results which are not relevant to your search
  • confusion of project structure
  • more time for searching (for huge projects)
  • modifying wrong files (in bin/build)

pycharm_duplicated_search

In order to avoid such problems in future I highly recommend excluding certain folders from indexing. This can be done by:

  • PyCharm/IntelliJ
  • Project Structure pane - ALT + 1
  • Select the folder which to be excluded
  • Right click on it
  • Mark Directory as
    • Excluded

This folder will be excluded from future indexing, find or show usages. The description from Jetbrains is:

Excluded roots are not visible to PyCharm. Usually, one would like to exclude temporary build folders, generated output, logs, and other project output. Excluding the unnecessary paths is a good way to significantly improve performance.

Note 1: You can also unmark folder in case of folder which was previously marked by:

  • PyCharm/IntelliJ
  • Project Structure pane - ALT + 1
  • Select the folder which to be unmarked
  • Right click on it
  • Cancel Exclusion

Note 2: There might be some exceptions like:

More info about Configuring folders in PyCharm/IntelliJ:

Share Tweet Send
0 Comments
Loading...