CLion 2019.3 Help

Control Source, Library, and Exclude Directories

You can manage files and directories of your project from the context menu of the Project tool window (Alt+1).

Exclude from indexing

CLion indexes your project files to enable such features as search, navigation, code completion, code generation, and refactorings. However, your project may contain files for which you don't need these features, for example, logs, binaries, or imported libraries.

In such cases, to reduce the indexing time, you can mark files as plain text and directories as excluded or libraries.

Exclude a file from indexing

If you don't need specific files, but you don't want to completely remove them, you can temporarily exclude these files from the project. Excluded files are ignored by code completion, navigation, and inspections.

To exclude a file, you need to mark it as a plain text file. You can always return excluded files to their original state.

  1. Right-click the necessary file in the directory tree of the Project tool window.

  2. Select Mark as Plain Text from the menu.

Plain text files are marked with the plain text icon icon in the directory tree.

To revert the changes, right-click the file and select Mark as <file type> from the menu.

Exclude a directory from indexing

If you don't want CLion to index a certain directory of your project, do the following:

  • In the Project tool window, right-click the directory you want to exclude and select Mark Directory as | Excluded:

    Mark directory as excluded

Code generation, code completion, and refactorings won't be available for this directory. The files won't appear in search results unless you select this directory explicitly in the Find in Path dialog Ctrl+Shift+F. The directory is marked as excluded the Excluded directory icon.

To include the directory back again, right-click it and select Mark Directory as | Cancel Exclusion.

Exclude a library from indexing

  • In the Project tool window, right-click the directory with the library files, and select Mark Directory as | Library Files:

    Mark as library files

Code generation, code completion and refactorings won't be available for this directory. However, you can make these files available in search results:

  • In Find in Path dialog Ctrl+Shift+F: narrow down your search by selecting the Project and Frameworks scope.

  • When searching everywhere (press twice): check Include non-project items or select Project and Frameworks from the list in the top right corner of the window.

To unmark the directory, right-click it and select Mark Directory as | Unmark.

Last modified: 20 February 2020