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.
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.
Right-click the necessary file in the directory tree of the Project tool window.
Selectfrom the menu.
Plain text files are marked with the 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 :
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 .
To include the directory back again, right-click it and select.
Exclude a library from indexing
In the Project tool window, right-click the directory with the library files, and select :
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.