Using the Find Sidebar

The Find Sidebar allows you to perform searches for a term across your entire project, as well as replace all instances of your search term in multiple files at once. It can be filtered to search and replace only the contents of particular files.

To perform a search operation, simply enter your query in the Find field and click Find. Results will appear in a list in the sidebar.

The Find Sidebar in Nova.

To replace all instances of a term in the results, enter the desired replacement term in the Replace field and click Replace All. All found instances of the term in the Find field will be replaced with the value of the Replace field.

NOTE: When searching remote projects, the Find Sidebar will only find results within files that are currently open. Nova cannot search the contents of remote servers.

Search Scopes

The Find Sidebar supports a few different configuration options for limiting the scope of your search.

Select a Folder: Click the Project button above the Find field to select a particular folder to limit your search to. You can choose to limit the search to a particular folder in your project, or even select a folder outside of your project’s root folder entirely.

Selecting a folder to search within.

Matching: Between the Find and Replace fields, you can choose whether the search should match any results that contain the query, completely match the word of the query, or only match the beginning or end of a particular word. Nova can also treat the query as a regular expression, and find results matching the regex pattern you provide.

Selecting criteria for results to match.

To the right of the Matching menu, you’ll find three additional options:

  • Match Case icon Match Case: Only return results that exactly match the case of the query as written.
  • Open Files icon Open Files: Only return results within files that are currently open in Nova.
  • Hidden Files icon Hidden Files: Choose whether to show results within hidden or ignored files, or within bundles (such as .app bundles).
The dropdown menu for searching hidden or ignored files.

Filters

Click the disclosure triangle next to Filters icon Filters to reveal additional filtering options.

Revealing the Filters section.

The Matching patterns field allows you to enter glob patterns, which can be super handy for easily limiting your search to certain directories or file extensions.

For more advanced filtering…

Custom Filters

Nova also allows you to create, save, and combine custom filters to use in the Find Sidebar. Custom filters can consist of multiple rules - for instance, you can create a filter that only searches .js files in a certain directory, or only files that have been modified since your last Git commit.

To create a custom filter, click the Filters icon Edit button.

Editing custom filters.

You can create custom filters that filter files by criteria including:

  • File name
  • Path
  • Path relative to the project root directory
  • File extension
  • Document status
  • Source Control/Git status

For instance, you could use these rules to create a search filter to limit your search only to .js files that have uncommitted Git changes:

This rule restricts the search to files that are both .js files AND have uncommitted changes.

This rule restricts the search to files that are both .js files AND have uncommitted changes.

Rules can be either included in results or excluded from the scope of a search. You can also choose to only include results that match all of a set of rules. For instance, the above rule for JS files will ensure results are limited only to files that are both .js files and have Git changes.

Selecting Including rather than Only including for this rule would mean that the search returns all .js files regardless of Git status, and all changed files regardless of extension.

This rule restricts the search to files that are either .js files, OR have uncommitted changes.

This rule restricts the search to files that are either .js files, OR have uncommitted changes.

Once you’ve configured custom filters, you can enable or disable them from the Filters section in the Find Sidebar. Filters will be grouped by whether results will match all the rules in that filter, or if they only need to match one or more of the filter’s rules.

Viewing multiple filters.

To put this in boolean logic terms, imagine you have two “Including” filters, two “Only including” filters, and two “Excluding” filters. Nova will scope the search to files matching the following logic:

(include1 || include2) && (onlyInclude1 && onlyInclude2 && !exclude1 && !exclude2)

This article was last updated on November 19, 2024