Fuzzy Folders

An Alfred Workflow


Short Description

Fuzzy search across folder subtrees.

Last Updated

10 Sep 2016

Compatibility

Yosemite
(10.10)
Mavericks
(10.9)
Mountain Lion
(10.8)
Lion
(10.7)
Snow Leopard
(10.6)
Yes Yes No No No
 

Version

2.3
 

Bundle ID

net.deanishe.alfred-fuzzyfolders
 

Author

Fuzzy search across folder subtrees. Add your own keywords to directly search specific folders.

Alfred 3 only. If you need Alfred 2 support, download version 2.2.

This Workflow provides partial matching of path components, allowing you to drill down into your filesystem with a space-separated query. Each "word" of the query will be matched against the components of a directory or file's path, so a three-word query will only match at least three levels down from the specified root directory.

You can use a File Action to intiate a fuzzy search on a folder or to assign a keyword to perform a fuzzy search on that folder.

Commands

  • fuzzy — List your Fuzzy Folders

    • — Edit Fuzzy Folder settings
    • ⌘+↩ — Start a Fuzzy Folder search with the associated keyword
    • ⌥+↩ — Delete the keyword–Fuzzy Folder combination
  • fzyup — Recreate the Script Filters from your saved configuration (useful after an update)
  • fzyhelp — Open the help file in your browser

Settings

You can specify these settings globally as defaults for all Fuzzy Folders or on a per-folder basis. For ad-hoc searches via the Fuzzy Search Here file action, the default settings always apply.

Use keyword fuzzy to view and edit settings.

  • Minimum query length — The last "word" of a query must be this long to trigger a search. Default is 1, but increase this number if the search is too slow. This is very often the case if you're searching a large subtree and/or also choose to search files.
  • Search scope — Choose to search only for folders, files or both. Note: In most cases, searches including files are significantly slower. Consider increasing the minimum query length to speed up slow searches.

File Actions

  • Fuzzy Search Here — Fuzzy search this folder
  • Add Fuzzy Folder — Set a keyword for this folder for faster fuzzy searching

Search result actions

  • — Open folder in Finder
  • ⌘+↩ — Browse folder in Alfred

Excludes

Fuzzy Folders supports global and folder-specific glob-style excludes (similar to .gitignore).

Currently, these can only be configured by editing the settings.json file by hand. To open settings.json, enter the query fuzzy workflow:opendata into Alfred. This will open the workflow's data directory in Finder and reveal the settings.json file.

The settings.json file will look something like this:

{
  "defaults": {
    "min": 2,
    "scope": 1
  },
  "profiles": {
    "1": {
      "dirpath": "/Users/dean/Documents",
      "keyword": "docs"
    },
    "2": {
      "dirpath": "/Users/dean/Code",
      "excludes": [
        "*.pyc",
        "/alfred-*"
      ],
      "keyword": "code",
      "scope": 3
    },
    "3": {
      "dirpath": "/Volumes/Media/Video",
      "keyword": "vids",
      "scope": 3
    },
    "4": {
      "dirpath": "/Users/dean/Documents/Translations",
      "excludes": [],
      "keyword": "trans"
    }
  }
}

The defaults key may not be present if you haven't changed the default settings and won't have an excludes member. Any profiles (saved fuzzy folders) added using a version of the workflow with support for excludes will be created with an empty list for the key excludes, but profiles created with earlier versions won't have an excludes member. Add it by hand.

excludes should be a list of strings containing .gitignore/shell-style patterns, e.g.:

"excludes": [
        "*.pyc",
        "/alfred-*"
      ],

In contrast to the other default settings, min (minimum query length) and scope (search folders (1), files (2) or both (3)), the default excludes will be added to folder-specific ones, not replaced by them.

So to exclude compiled Python files from all fuzzy folders, add *.pyc to the excludes list under defaults:

{
  "defaults": {
    "min": 2,
    "scope": 1,
    "excludes": ["*.pyc"]
  }
}

Bugs, questions, feedback

You can open an issue on GitHub, or post on the Alfred Forum.

Licensing, other stuff

This Workflow is made available under the MIT Licence.

The icon was made by Jono Hunt.

It uses docopt and Alfred-Workflow.

Screenshots