Fix Sublime Text using high CPU usage

For a while now when using Sublime Text the fans on my laptop would spin up rather loudly, indicating high CPU usage. Just now I found out the issue and solution(s): indexing.

To confirm that indexing is the issue, you can check Sublime Text’s Indexing Status at Help > Indexing Status

Solution 1: Turn off indexing

Turning off indexing immediately solved the issue for me. This is fixed by opening up Sublime Text’s preferences (on a Mac: Cmd + , ) and adding to the right windows (which overrides default settings):

“index_files”: false

Note that this solution affects the “Go to definition” function.

Solution 2: Exclude “heavy” directories

In Sublime Text’s preferences, add:

    "folder_exclude_patterns": [
        "node_modules",
        "a_heavy_directory_name"
    ]

The “Go to definition” function works with this solution.

Sources

Leave a comment