Macotron

File search

The File Search plugin finds files and folders by name as you type in the launcher. It reads from Macotron's own file index, not Spotlight, so results appear in milliseconds even on a large disk.

Using it

Open the launcher and type two or more letters of a file name. Matching files appear below the apps and commands.

KeyAction
ReturnOpen the file.
⌘ReturnReveal it in Finder.
⌥ReturnQuick Look preview.
⌘CCopy the path.

Type a query with a slash to complete a path. Each segment matches one folder level, ~ is your home folder, and a trailing slash lists a folder.

Files you open from the launcher move up the list. Reset File Ranking forgets those counts, for one path or for every file.

How matching works

Matching ignores case. Better matches rank first:

  1. The exact name.
  2. The start of the name.
  3. The start of a word in the name: budget finds Q3 Budget.pdf. Words split on spaces, -, _, ., and camelCase.
  4. Anywhere in the name.
  5. Letters in order inside the name: ctrct finds contract.
  6. Letters in order inside the path: docdad finds Documents/Dad.

The last two apply only to words of three or more letters. A query with spaces is a set of words that must all match. When two results tie, the one in a shallower folder wins.

What gets indexed

By default the index covers:

It skips node_modules, *.tmp, go/pkg, and all of ~/Library, which holds keychains, cookies, mail, and app state. iCloud Drive and cloud storage live under ~/Library, so they are listed as scopes of their own. A scope inside an ignored folder is still indexed.

It always skips the contents of bundles such as .app, .framework, and .photoslibrary. The bundle itself is one entry. Symlinks are listed but not followed. Names that start with a dot are left out unless you turn on hidden files.

The index watches the disk. New, moved, and deleted files show up in a couple of seconds.

Settings

Open Settings → Plugins → File Search.

SettingDefaultWhat it does
Search scopesThe four folders aboveOne folder per line. ~ is home.
Ignore patternsnode_modules, *.tmp, go/pkg, LibraryOne glob per line, in .gitignore style. A bare name skips every folder with that name; a path such as Library/Caches skips that one path inside a scope.
Include hidden filesOffIndex names that start with a dot.
Honour ignore filesOnSkip what .gitignore, .ignore, and .macotronignore files exclude.
Search file contentsOffAdd files whose text contains the query, from Spotlight, below the name matches. Only for queries of three or more letters.
Result count8How many files to show in the launcher.

The Checks section of the plugin page shows the index state: "Indexing…" while it builds, then the number of files indexed. A bad ignore pattern shows its error there.

Commands

When the index is not available

The index runs as a small helper program inside the app bundle. If it cannot start, the plugin's check reads "Indexer unavailable, using Spotlight" and searches go through Spotlight until the index is back. Spotlight is slower and hides some folders, but it still finds files.

Search from your own plugin

const hits = await macotron.files.search("invoice", { kind: "pdf", limit: 10 });
for (const h of hits) console.log(h.path);

See also