How to fix slow refactoring operations in CLion?

In this post learn how to make refactoring, renaming, and basic file operations in your CLion fast.

How to fix slow refactoring operations in CLion?

There are multiple tweets, posts, and Hackernews comments complaining about the sluggish nature of basic operations in CLion — like renaming a file, renaming a function, and moving a file from one location to another.

The worst part is that this might happen in small-scale projects as well.

Alright, so how do we fix these?

  1. Find the (big) generated folders of your CMAKE project — like for eg build/.
  2. Right-click → Mark Directory as → Excluded.
  3. Do this process for all these generated folders, specific to your project.

Now CLion will exclude this folder for all indexing purposes, making these basic operations (hopefully) much faster.