GoToFile

GoToFile is a fast, flexible and accurate utility to find files and folders on your Mac.

Table of Contents

Initial Setup

GoToFile works out-of-the-box without any configuration, but we recommend setting up a keyboard shortcut to open the search panel. To do this, select “Preferences…” from the Menu Item menu item and configure the System Wide Hot Key in the Access section of the Preferences dialog.

Basic Operation

GoToFile runs in the background and only becomes visible when you need it. Select “Go to File…” from the Menu Item menu item or press the configured keyboard shortcut to open the search panel. You will see an input field like this:

You can start typing right away. GoToFile will recursively fuzzy-search for filenames in your home folder containing the characters you type in the order you type them. You can use the cursor keys and to navigate the result set. Press to open the selection with its default application. Press ⇧⏎ to open the selected item in the frontmost application.

The icon of an item in the result list can be dragged on applications supporting drag&drop. The search panel will be automatically be hidden when a drag operation is initiated. If the operation fails (no valid drop target has been found) the search panel appears again.

Note: A rotating letter in the center of the magnifying glass indicates that GoToFile is indexing the current Project. GoToFile can be used while scanning is in progress.

Note: Check Keyboard Shortcuts for a complete list of available commands.

Modes of Operation

This is where you do the searching. Be it in a directory or in a project. Use ⌘⇧B to show the selected item in the browser. Learn more…

Browser (⌘B)

Use this mode to traverse a file system hierarchy manually. Press ⌘⇧S to search the selected directory recursively. Learn more…

Projects (⌘P)

This is where you go when you want to select another project to search. Learn More…

Recent Items (⌘R)

This mode shows a list of recently modified items. Learn more…

Marked Items (⌘M)

This mode shows a list of items you have marked using ⌃M in any of the other modes with the exception of Projects. Learn more…

Note: Check Keyboard Shortcuts for a complete list of available commands.

Search Mode

Modern computers are capable of storing millions of files. When searching a large number of files it becomes hard to find the one you are looking for by just typing a few characters. Not with GoToFile.

Fuzzy Search

When entering a lower case search string GoToFile will search for filenames which contain all the characters of the search string in the order they appear in the search string. Matching characters may be interspersed with others. The lower the distance between matching characters, the higher the item will be ranked. Upper case characters in the search string will favor matching characters at the beginning of words or upper case characters within words (CamelCase).
Example: Assume the searched directory contains three files:

  1. Vampires.pdf
  2. VectorArithmeticMultiProcessor.pdf
  3. vesicle associated membrane protein.pdf

Entering vamp will return the list as shown. Vampires.pdf is considered the best match as all characters of the search string appear in the file name without gaps. Entering VAMP, however, will return Vampires.pdf as the least likely match. In this case GoToFile prefers file names containing the characters of the search string at the beginning of word boundaries. Shorter names are always ranked higher, so the order would be:

  1. VectorArithmeticMultiProcessor.pdf
  2. vesicle associated membrane protein.pdf
  3. Vampires.pdf

You can use more than one search term by seperating them with at least one (space) character. The order of search terms is not important. If you want to search for items containing a character you have to prefix it with a backslash: lng\ fn will match long filename but not longfilename.

Regular Expressions

If fuzzy searching does not yield the desired result you can use regular expressions. Search terms prefixed with + or - will be considered a Regular Expressions. The positive Regular Expression (+) will show only matching items while the negative one (-) will hide matching items.

Regular expressions can be used by themselves or mixed with ordinary search strings. They have to be separated from other search terms by at least one (space) character.

Example: You want to exclude PDF files from your result list. Insert a space character after your search string and enter the expression -\.pdf$. The expression translates to “any file having the ‘.pdf’ filename extension”. Note: The dot character has the special meaning “match any one character” in regular expressions. To match the dot character itself it has to be escaped (prefixed by a backslash character).

Example: You searched for tree and the result contained entree, extreme, street, and treetop. You want to search for the characters in tree in consecutive order. Insert a + before your search, so your input reads +tree. This will match only entree, treetop, and street.

The regular expression syntax currently supported by GoToFile is that specified by ICU. It is described in detail at http://userguide.icu-project.org/strings/regexp. The site https://regex101.com is a great place to experiment with regular expressions.

Regular expression matches in GoToFile are case insensitive.

Search Scope

Search by filename or by complete path

To the right of the Info Bar you see an icon that, depending on the search mode, looks like a % or like a % with the left circle omitted. Click it to switch between filename-only and full-path search. Its keyboard shortcut is ⌘⇧O.

Showing files or folders only

To the right of the Info Bar you see two small icons, one depicting a file, one depicting a folder. Clicking on them lets you show or hide items of the respective type. Alternatively you can press ⌘⇧F to toggle displaying of files and ⌘⇧D to toggle displaying of directories.

Filter by path

Use ⌃← or ⌃→ to highlight a path component of the currently selected item. Press ⌘- to temporarily hide all items located at the highlighted path component or one of its descending folders. Press ⌘= to temporarily show only items located at the highlighted path component or one of its descending folders. The filter icon will be displayed in the Info Bar and the result set will be immediately updated.

The commands ⌘- and ⌘= also work without highlighting a path component. In this case the selected folder or, in case the selected item is a file, the folder containing the selected file is used.

Both actions can be combined and performed multiple times to narrow down the result set. Click the filter icon or press ⌘⎋ to reset the filter.

Limit search scope to the currently selected item

Press ⌘⇧S to recursively search the selected folder. If the selected item is a file the folder containing the file will be searched recursively. This action will create an ad-hoc project. Use the Project Selector (⌘P) to switch back to a configured project or press ⌘P two times to switch back to the most recent project.

The result is similar (not identical!) to focussing on path components (⌘=). Global rules apply to ad-hoc projects as well but only real projects can have directory-specific rules.

Search folder containing the document of the frontmost application

Note: This feature works with many document-based applications. If you encounter an application where this feature does not work, please contact us.

This action creates an ad-hoc project from the folder containing the document of the frontmost application.

  1. Open the search panel while any document-based application is active
  2. Press ⌘⌥S

Projects Mode

This mode provides a searchable list of Projects.

Projects give you a way to search otherwise unrelated folders at the same time. You can define default settings on a per-project basis.

Switching projects

  1. Press ⌘P to get to the list of projects
  2. Type a few characters or use the cursor keys to make the new project the selected item
  3. Press to select the project

The Project Editor

You use the Project Editor to make changes to the current project, define new ones, or delete existing projects.

Create a new project

  1. Press ⌘⌥P to open the project editor
  2. Create a new project by clicking the + button below the Projects list
  3. Name your new project
  4. Add the desired folders to the “Search folders” list to the right of the Projects list
    1. (optional) Specify if and how you want to limit the search depth for the Search Folder. By default the search depth is unlimited.
    2. (optional) Specify subfolders to exclude from the Search Folder just created. By default no subfolders are excluded.
    3. (optional) Specify if GoToFile should honor the global list of excluded folders (as configured in the GoToFile Preferences) for this Search Folder. By default GoToFile takes the global list of excluded folders into consideration.
    4. (optional) Specify rules to configure which items inside the Search Folder should appear in the index. By default any item in the project folder will appear in the index.
    5. (optional) Specify if GoToFile should honor the global rules (as configured in the GoToFile Preferences) for this Search Folder. By default global rules will be considered.

Scan Parameters

Patterns

To keep a folder from being scanned, or to specify which items to include in GoToFiles index you have to specify a pattern describing the file or folder.

Literals, Wildcard patterns, and regular expressions may begin with, and/or contain a path separator. In the former case the pattern is matched against the complete path, relative to the root directory being scanned. In the latter case the pattern is matched against the tail of the complete path. Patterns without path separator are matched against the item name only.

We assume that a directory Folder with the following contents has been configured for searching:

Folder
├── Archive
│   ├── Private
│   │   ├── John
│   │   ├── Mary
│   │   └── Tim
│   └── Work
│       ├── John
│       ├── Mary
│       └── Tim
└── Live
    ├── Private
    │   ├── John
    │   ├── Mary
    │   └── Tim
    └── Work
        ├── John
        ├── Mary
        └── Tim

The patterns will be matched against different sections of a path according to the existence and position of path separators in the pattern:

Pattern Effect
Mary Matches all four items Mary
Work/Mary Matches Archive/Work/Mary and Live/Work/Mary
Live/*/Mary Matches Mary in Live/Private and Live/Work
/Archive/Work/Mary Matches only Archive/Work/Mary. Archive has to be a direct descendent of the configured folder Folder.

All matches are case insensitive.

GoToFile understands three types of patterns: Literal, Wildcard, and Regular Expression.

Literal

This is the most basic pattern. There are no special characters.

Pattern Description
/Library Matches a file or folder named Library which is a direct descendent of the search folder
Library Matches any file of folder named Library regardless of its position in the filesystem hierarchy.

Wildcards

Use this type of pattern for basic matches. GoToFile supports the following wildcards:

Wildcard Description
* Match any number of any character
? Match any character
[abc] Match any of the characters a, b, or c
[!abc] Match any character except a, b, or c
[a-z] Match any character from the range a to z
[!a-z] Match any character not in the range a to z
/*/ Match any single directory
/**/ Match any number of directories

Example: The wildcard pattern *.pdf matches any item having the file name extension .pdf.
Example: The wildcard pattern *.t[xs]t matches any item having the file name extension .txt or .tst.

Regular Expressions

In case Wildcards are not sufficient to describe a path you can use regular expressions. The regular expression syntax currently supported by GoToFile is that specified by ICU. The site https://regex101.com is a great place to experiment with regular expressions.

Regular expression matches in GoToFile are case insensitive.

Subfolders not to scan

The default project that is defined in GoToFile is called Home. It contains the home folder as the only directory to search. But the home folder contains subfolders which don’t contain items users are likely to look for. One such folder is Library. The default project Home has an exception configured which tells GoToFile to not scan the folder Library. This saves time when traversing the home directory and it keeps the result list from being cluttered by unwanted items.

What if there is a folder Important in Library you’d like to scan? The list of folders to search is processed sequentially. You just have to create a new Search Folder ~/Library/Important and move it before your home folder.

Hint: You can add a folder to this list while searching. Select a folder in the search result list and click ‘Exclude from Search Folder’ from the popup menu in the search field.

Items to ignore

By default every item found in a configured folder is recorded in an index. But for every folder in a project rules can be configured. These rules tell GoToFile which items should be included in or excluded from the index.

GoToFile knows two types of rules: include and exclude. When defining include rules only items matching the rules will be recorded in the index. Everything else is ignored. When defining exclude rules items matching the rules will not be recorded in the index. Everything else is included.

Duplicating scan options

Defining excluded subfolders and folder rules is done on a per-folder basis. If a project consists of multiple folders these settings don’t have to be made to every folder manually. Just drag an already configured folder from the ‘Search folders’ list and drop it on another folder in this list. All settings of the drag source will be applied to the drag destination.

Search Parameters

These options don’t affect the index. They just control which items from the index are displayed. Changes to these settings are always persisted.

Filter by item type

Here you select if you want to see files and/or folders in the result list. You can toggle this option from the search field by pressing ⌘⇧F (toggle files) and ⌘⇧D (toggle directories).

Search path or file name only

When checked the whole path is searched instead of the filename only. This option may slow down the search a bit. You can toggle this option from the search field by pressing ⌘⇧O (with ‘O’ as in ‘Only’).

Browser Mode

If you know the name of an item Search Mode is the fastest way to get there. If you don’t, you press ⌘B to activate Browser Mode. Initially the contents of you home folder will be displayed. Type a few characters to only display matching items. Press ⌘↑ to go to the parent directory, press ⌘↓ to browse a folder. ⌘⇧S will search the selected folder (or the folder containing the selected file) recursively.
Note: Check Keyboard Shortcuts for a complete list of available commands.

Recent Items Mode

This mode shows a searchable list of the most recently created/modified items in the directories associated with the current project. You can exclude folders from monitoring by unchecking the ‘Show in Recent Items’ checkbox of the folder in the Project Editor.

When GoToFile starts this list is empty. It is populated in real time while GoToFile is running.

If no search term is entered the list is ordered by modification date in descending order. Once a search term is entered the list is ordered according to best matches.

Marked Items Mode

This mode shows a searchable list of items marked in any of the other modes (with the exception of Projects) using the ⌃M keyoard shortcut. Use ⌃M on an already marked item to remove it from the list.

You can recognize a marked item by its star badge in the upper left corner of the items icon.

There is one list of marked items for all Projects. It is persisted across restarts.

Operating on the selection

Once the desired item has been found and selected GoToFile allows for several operations. For a complete list consult the section keyboard shortcuts.

Drag&Drop

The icon of an item in the result list can also be dragged on applications supporting drag&drop. The search panel will be automatically be hidden when a drag operation is initiated. If the operation fails (no valid drop target has been found) the search panel appears again.

If the icon of an selected item is dragged, all selected items take part in the drag operation. Dragging the icon of an unselected item will only make this particular item a drag source. Selected items will be ignored in this case.

Preferences

Preferences Screenshot
Preferences Screenshot

The preferences window is divided into three parts: Access, Global Search Parameters, and Global Scan Parameters.

Access Parameters

Here you can set the global hotkey to bring up the search panel. The Menu Item can also be hidden if desired.

Global Search Parameters

Here you limit the maximal number of items visible in the result table. You can also configure if bundles are to be treated as files. The latter affects the filtering of results by type.

Global Scan Parameters

Don’t scan folders matching pattern: This is where you can exclude folders from being scanned. Configuration works similar to exclusion lists in the Project Editor. Exclusions defined here are appended to the list of excluded folders of all search folders of any project unless the scan folder’s ‘Ignore global exclusions’ box is ticked. Patterns are matched against paths relative to the search folder. So if you configure /tmp and the current search folder is /Users/me the pattern will match /Users/me/tmp. Global exclusions also affect ad-hoc projects.

Never show items matching pattern: You can also prevent certain items from appearing in the index. The default settings will match temporary (file names ending or beginning with ~) and hidden files (file names beginning with .). Refer to the Project Editor for details.

Finder Integration

Search Folder

  1. Select the folder in Finder
  2. Select “GoToFile: Search” from the Services menu

This action creates an ad-hoc project from the selected path and sets it as the current project.

Note: You may want to assign a keyboard shortcut to this service in the macOS Sytem Preferences: Open System Preferences>Keyboard>Shortcuts and select Services from the left hand table below. Locate and select GoToFile: Search in the Search section of the table next to it. Click Add Shortcut and press the desired shortcut.

Browse Folder

  1. Select the folder in Finder
  2. Select “GoToFile: Browse” from the Services menu

Note: You may want to assign a keyboard shortcut to this service in the macOS Sytem Preferences: Open System Preferences>Keyboard>Shortcuts and select Services from the left hand table below. Locate and select GoToFile: Browse in the Files and Folders section of the table next to it. Click Add Shortcut and press the desired shortcut.

Keyboard Shortcuts

Keyboard shortcut Action
Move selection up
Move selection down
⇧↑ Extend selection up
⇧↓ Extend selection down
⇞ (first item selected) Move selection to first item on previous page
⇞ (other item selected) Move selection to first visible item
⇟ (last item selected) Move selection to last item on next page
⇟ (other item selected) Move selection to last visible item
Move selection to first item
Move selection to last item
⇧↖ Extend selection to first item
⇧↘ Extend selection to last item
⌘⇞ Scroll to previous page, keep selection
⌘⇟ Scroll to next page, keep selection
⌘↖ Scroll to first page, keep selection
⌘↘ Scroll to last page, keep selection

General

Keyboard shortcut Action
⌘S Switch to Search Mode
⌘⌥S Search folder containing document of frontmost application; This action creates an ad-hoc project with only a single search folder.
⌘B Switch to Browser Mode
⌘P Switch to Project Mode
⌘⌥B Browse folder containing document of frontmost application
⌘R Switch to Recent Items Mode
⌘M Switch to Marked Items Mode
↹ (Search Mode) Switch to Browser Mode
↹ (any other mode) Switch to Search Mode
⌘⌥P Toggle Project Editor
⎋ (text) Clear input field
⎋ (no text) Close search window and reset filters. If an ad-hoc project was searched, the previous “regular” project will be selected. Search mode will be restored.
⌘W Close search window and leave search string, filters, current mode, and project untouched
⌘A Select every item

While a file/folder is selected

These actions are performed on all currently selected items or, if a path component of the selected item is highlighted, on the highlighted path component. See Selection for details.

Keyboard shortcut Action
Open selection with default application
⇧⏎ Open selection with active application
⌘⏎ Type path of selection into active application
⌘⇧⏎ Type name of selection into active application
⌥⏎ Copy path of selection to pasteboard
⌥⇧⏎ Copy name of selection to pasteboard
⌃⏎ Rename selection
⌘F Reveal selection in Finder
⌘I Show Finder info for selection
⌘⌫ Move selection to Trash
⌘E Edit selection in default text editor
⌘T Open new Terminal window and cd to selection (iTerm2 if available, Terminal otherwise)
2x⇧ Preview selection with Quick Look
⌘⎋ Send selection to Quicksilver
⌘L Scroll to selection
⌘⇧S Search selection; Creates an ad-hoc project from the selected path and sets it as the current project
⌘⇧B Browse selection. If the selected item is a folder, the browser will open at this location. If it is a file, browser will open the folder containing the file and select the file.
⌘⇧P Create new project from the selection. The new project will contain the selected folder as Search Folder. If the selected item is not a folder, its containing folder will be added as Search Folder instead. The new project will take on the name of the Search Folder.
⌃C Mark selection as copy source; Subsequently pressing ⌃C on another item will make this item the copy source; The copy source will remain set after performing the copy operation via ⌃V.
⌃D Duplicate selection
⌃X Mark selection as move source; Subsequently pressing ⌃C on another item will make this item the move source; The move source will be cleared after performing the move operation via ⌃V.
⌃V Perform the file operation initiated with ⌃C (copy) or ⌃X (move). If the selection is not a directory the item will be copied/moved into the folder containing the selection. If the selection is a folder the item will be copied/moved into this folder.
⌃M Toggle the Marked flag of the selection. Marked items are visible in Marked Items Mode.
Keyboard shortcut Action
⌘` Switch between current and previous project
⌘1, ⌘2, …, ⌘0 Switch to project 1…10; Projects are numbered according to their position in the Project Editor (⌘⌥P). You can re-arrange them in the Project Editor with drag&drop or by assigning them numbers directly (see next row).
⌘⇧1, ⌘⇧2, …, ⌘⇧0 Make the current project accessible via ⌘n where n is the number pressed. This will effectively re-arrange the project list by swapping the position of the current project with the position of the project previously in this spot.

Search / Recent Items

Keyboard shortcut Action
⌘⇧O Toggle ‘Search last path component’/‘Search complete path’
⌘⇧F Toggle ‘Show Files’
⌘⇧D Toggle ‘Show Directories’
⌃←, ⌃→ Shrink / extend path selection
⌥⎋ Clear Live Path Filter
⌘= Add selection to Live Path Filter; This limits the search result to items in the selected folder (or the folder containing the selected file) and its subfolders; More than one filter may be applied. Press ⌘⎋ to reset the filter.
⌘- Add selection to Live Path Filter; This excludes items in selected folder (or the folder containing the selected file) and its subfolders from search result; More than one filter may be applied. Press ⌘⎋ to reset the filter.

Projects

Keyboard shortcut Action
Search project
⌘P Switch to most recent project. This is useful when the last search was made in an ad-hoc project by pressing ⌘⇧S on any item. In this case the current project would be replaced by an ad-hoc project consisting only the selected folder (or the selected item’s containing folder). While in Search mode you can press ⌘P twice (first time to get to the Project Selector, second time to switch back to the actual project you came from).

Browser

Keyboard shortcut Action
⌘↑ Browse parent folder
⌘↓, / Browse selected folder
⌘. Toggle ‘Show Hidden Files’
⌘⇧F Toggle ‘Show Files’
⌘⇧D Toggle ‘Show Directories’

Terminology

Index

The index is a database which helps speeding up the search process. The database is held entirely in memory. It is populated whenever a project/folder is selected for the first time after the program starts. Later on the database is updated in the background whenever changes are made to the file system.

Project

A project is a collection of folders to search. It also defines how these folders are searched and which items should be stored in the index. Projects are configured in the Project Editor.

Ad-hoc Projects

An ad-hoc project is like a project containing only a single directory to search, but it is not created (or visible) in the Project Editor or in the Project Selector. Instead it is implicitly created when searching a directory by pressing ⌘⇧S while an item is selected in either Search, Browse, or Recent Items Mode. When searching an ad-hoc project the Info Bar will display ‘Search directory …’ instead of ‘Search project …’. Press ⌘P twice to switch back to the previous project. Closing the search panel via with an ad-hoc project active will switch back to the most recent “regular” project for the next search. Pressing ⌘W will also close the window but leave the ad-hoc project active.

Selection

In every mode the selection is the item selected in the result table. Actions operate on the selection. In Search Mode, Recent Items Mode, and Marked Items Mode you can further choose which part of the path is considered for actions. Use ⌃→ and ⌃← to select different parts of the selected items path. Once part of the path is highlighted actions will operate on this path component instead of the full path. The selection icon reflects this change. Clear the highlighting by either selecting a different item of by using the Clear Highlight (⌃↑, ⌃↓) command.