How to search for git excluded folders in Zed
I keep a few personal folders in my projects that I do not want to commit, such as a .todo folder with a list of things I need to address. Instead of adding them to the shared .gitignore, I exclude them locally in .git/info/exclude.
Zed leaves gitignored files out of the file finder (Cmd+P) and project search by default, so those folders seem to disappear. Project search has an “include ignored” toggle, but it pulls in everything that’s ignored, such as node_modules, so I prefer to include just the folders I want.
You can toggle ignored files on in the file finder, but to always include a folder, add it to file_scan_inclusions in your user settings (zed: open settings file from the command palette):
{
// Index my git-excluded notes folder so search finds it.
// Keep Zed's default ".env*": setting this list replaces it.
"file_scan_inclusions": [".env*", ".todo/**"]
} This is the existing entry in default settings that we have overridden above in the user settings.
// Files or globs of files that will be included by Zed, even when ignored by git. This is useful
// for files that are not tracked by git, but are still important to your project. Note that globs
// that are overly broad can slow down Zed's file scanning. `file_scan_exclusions` takes
// precedence over these inclusions.
"file_scan_inclusions": [".env*"],