Sublime Text editor provides a sidebar to view the files and folders when you open the project or add a folder to the workspace.

You can hide files with extensions or folders in the left sidebar.

This post talks about how to view whitespace and tab characters.

How to hide files with certain extensions or folders in Sublime Text Editor?

There are multiple ways we can add at the global user level and project level

  • User Global Setting: This applies to all projects and applications
  • Project Settings: This applies to only a single project

User Global Setting to hide files and folders:

Here are the steps

  • Open Sublime text editor( 2 or 3 versions)
  • Go to the Preferences Menu-> Settings item
  • You should see two tabs opened below the screen.
    • Preferences. sublime-settings – Default: It is readonly, not editable
    • Preferences. sublime-settings – User settings: It is user preferences and settings configurations that you can add to it

Sublime text preferences settings

The above two are json configurations.

  • you can add the below attributes
    • folder_exclude_patterns: It contains a string array of the folder to exclude
    • file_exclude_patterns: It contains a string array of file names and extension patterns.

You can add these two attributes to Preferences. sublime-settings – User

 "folder_exclude_patterns": [".idea", "node_modules"],
 "file_exclude_patterns": ["*.bak"],

Save the above changes, It hides the .idea folder node_modules folders, and *.bak files in the left side navigation tree.

Applications Setting to hide files and folders:

Here are the steps

  • Create a file .sublime-project under your project

  • update draw_white_space value to all as seen below

    The updated json object contains the following.

    "folders": [{
        "path": ".",
        "folder_exclude_patterns": [".idea","node_modules"],
        "file_exclude_patterns": ["*.bak"]