Skip to content

Searching a File

The search panel finds text anywhere in the open file and lists the matches while the search runs.

Press Ctrl + F or select Search in the toolbar. The panel opens over the top-right corner of the viewer, with the cursor in the search box. Press Ctrl + F again to close it.

  1. Type what you want to find in the search box.

  2. Set the search options, for example Aa to ignore case.

  3. Press Enter.

The search starts only when you press Enter. Changing an option does not run the search again; press Enter after you change it.

While the search runs, a progress bar shows how much of the file Vaste has read, and the status line shows how many matches it has found so far. The first match becomes the current match as soon as Vaste finds it. When the search finishes, the status line shows the number of matches and how long the search took.

If the pattern is not valid, for example a regular expression with an unclosed bracket, the panel shows the error in red.

The buttons next to the search box set how Vaste matches the pattern:

Button Name Effect
Aa Case Insensitive Ignores the difference between uppercase and lowercase ASCII letters. Off by default, so searches match case.
W Whole Word Matches only whole words.
.* Regex Reads the pattern as a regular expression.
Multi Multiple patterns Reads the pattern as several literal patterns separated by |, for example ERROR | WARN.
0x Hex Byte Search Reads the pattern as hexadecimal bytes, for example FF D8 FF E0.
Str Strings Lists runs of printable text in the file. The search box filters the runs and can be empty.

.*, Multi, 0x, and Str turn each other off. W and .* are hidden while 0x or Str is on, W is also hidden while Multi is on, and Aa is hidden while 0x is on. For what each mode matches, see Search modes.

The counter next to the search box shows the current match and the number of listed matches, for example 3/250. If nothing matches, it shows No results.

  • Press F3, or select Next match, to go to the next match.
  • Press Shift + F3, or select Previous match, to go to the previous match.

Moving past the last match goes back to the first. The current match scrolls into view, is highlighted in its own color, and its line becomes the active line. F3 and Shift + F3 keep working after you close the search panel. These two keys cannot be changed in the shortcut editor.

You can also select a match in the results list. See Working with results.

To stop a running search, press Esc or select the close button (Close (Escape)). This closes the panel and stops the search. Pressing Enter while a search runs stops it and starts the search again with the current pattern and options.

Closing the panel keeps the pattern and the listed results, and Copy, Export…, Grep view, and the search chain keep working on them. Press Ctrl + F to show the panel again. If you close the panel while a search runs, the search stops and the status line shows Cancelled, N matches so far: the listed results are the ones found before the stop.

To find how often a pattern occurs without building the list of matches, select More actions (…) in the search panel, then select Count. While it runs, the button shows Counting…. When it finishes, the status line shows the number of matches and the time, followed by count only.

Count uses the pattern and options in the search panel. It does not fill the results list or highlight matches.

The status line shows the count only while no search has run in the panel. After you run a search, the status line shows the search results instead.

Vaste keeps the results of recent searches for each open file. Running the same search again with the same options shows the results at once, and the status line adds (cached).

These actions clear the results:

  • Reloading the file, including an automatic reload when the file changes on disk.
  • Reopening the file with another encoding.
  • Opening another file in the window.

After a reload, the pattern and options stay in the search panel. Press Enter to search again.

Select More actions (…) in the search panel to show a row of actions for the current search:

Below the status line, the Combine searches section adds the current search to a chain of searches. See Combining searches.