Ben Reich
Ben Reich

Reputation: 16324

Permanently exclude directory in IntelliJ

I have an IntelliJ project that includes a directory of some huge files. Since those files were added to the project, we've noticed a degradation in performance such as momentary freezes and general sluggishness. Marking the directory as excluded (context menu -> Mark Directory As -> Excluded) seems to help the problem. However, this option is never persisted across sessions, so that when I reopen IntelliJ and open the project the folder is not marked as excluded. How can I permanently mark this directory as excluded?

Running IntelliJ IDEA 13.1.4 on Mac OS X 10.9.4.

Upvotes: 11

Views: 2423

Answers (3)

Rustam Aliyev
Rustam Aliyev

Reputation: 629

I am using IntelliJ IDEA 2020.1.4 and Bazel build and was trying to exclude .bazel-cache directory so that it does not pop-up in search. Unfortunately, neither osundblad's nor cobbzilla's answer resulted in permanently hiding that directory.

What helped instead:

File -> Settings -> Editor -> File Types -> Ignore files and folders

and added .bazel-cache separated with ;.

Upvotes: 3

cobbzilla
cobbzilla

Reputation: 1990

To expand on osundblad's answer, this now works fine in more recent versions of IntelliJ:

  • Open the module settings for the source module that is rooted somewhere above the directories you want to exclude. If you right-click on the directory in the Project view, you should see Open Module Settings in the context menu, click that.
  • The "Project Structure" window should appear, with tabs named Sources, Paths, and Dependencies
  • In the Sources tab, at the bottom of the file-tree control, find the text box labeled Exclude Files
  • Say you had directories foo and bar/baz that you wanted to exclude: enter foo*;bar/baz*; apply/OK the changes, and they will be permanently excluded from the project.

Upvotes: 1

osundblad
osundblad

Reputation: 2681

In project Settings under Sources tab you can mark directories as excluded.

Upvotes: -2

Related Questions