VSCode Setup

Toggling the hiding of files and folders in the file explorer

Most of the time I am not opening the node_modules or .next folder and I want it hidden in the file explorer. However there may be times that I want to and not have to go into user settings to do it. You can see what is hidden at all times by going to settings cmd + , and searching for Files: Exclude. One example of a folder that will be in there by default would be the .git folder. That is an example of a folder that I would keep on that list, but there are a few that I want to be able to toggle on and off. Here is an example of how I am doing it:

  1. Install the VScode extension Toggle (Peng Lv)

  2. cmd + Shift + P search for keyboard and open Preferences: Open Keyboard Shortcuts (JSON)

  3. Paste in the following and edit to your liking

    {
        "key": "cmd+t",
        "command": "toggle",
        "args": {
            "id": "exclude",
            "value": [
                {
                    "files.exclude": {
                        "**/node_modules": true,
                        "**/.turbo": true,
                        "**/.next": true,
                        "**/next-env.d.ts": true,
                        "**/.next-render": true,
                        "**/*.tsbuildinfo": true
                    }
                },
                {
                    "files.exclude": {
                        "**/node_modules": false,
                        "**/.turbo": false,
                        "**/.next": false,
                        "**/next-env.d.ts": false,
                        "**/.next-render": false,
                        "**/*.tsbuildinfo": false
                    }
                }
            ]
        }
    }
  4. Now toggle the items you want to hide via cmd + t (or whatever you chose)