Skip to content

TUI Search & Marks

vaste-tui searches the whole file with the same engine as the desktop app. Search works in Text, Hex, and NDJSON views. The table view has no search: press t to switch to Text view first.

  1. Press /. The footer becomes a search bar that starts with /.

  2. Type the text and press Enter.

vaste-tui moves to the first match as soon as it finds one. Press n for the next match and N for the previous one. After the last match, n goes back to the first.

To clear the search, press Esc. Esc in the search bar, or Enter with nothing typed, also cancels the current search and clears its results. The search bar has no history.

While the search bar is open, these keys change how it searches. Use the lowercase letter with Alt.

Key Mode or option Search bar shows
Alt + l Literal text. This is the default. [Lit]
Alt + r Regular expression [Reg]
Alt + h Hex bytes, such as FF D8 FF [Hex]
Alt + m Several literal patterns separated by |, such as error|warn [Mul]
Alt + i Ignore case [i]
Alt + w Whole words only [w]

The mode and options stay set for the rest of the session. The syntax is the same as in the desktop app: see Search modes. Ignoring case applies to the letters A to Z only. Regular expressions do not work in UTF-16 files, and vaste-tui shows Regex search is not supported for UTF-16 encoded files. in that case.

The search bar uses the usual text editing keys, such as Backspace, Delete, Home, and End. In the search bar, Ctrl + C does not quit. See TUI keybindings.

While the search runs, the footer shows its progress, for example /timeout searching 42%…. When it finishes, the footer shows the pattern, the number of matches, and your place among them, for example /timeout 1204 matches [3/1204]. If there are no matches, the footer shows 0 matches.

In Text and Hex views, matches are highlighted in cyan, and the current match in green. In Hex view, both the hex and the ASCII columns are highlighted. The NDJSON view does not highlight matches.

In Text and Hex views, the lower part of the screen lists the matches, with the line number or the offset and the start of the matching text. The current match is green. The list follows n and N: you cannot select a match in it directly. It closes when you clear the search with Esc.

vaste-tui keeps the first 10,000 matches for n, N, and the list, and still counts every match. The footer adds (capped) when there are more. (cached) means vaste-tui reused the result of the same search on the same file. To count matches without listing them, use :count.

If the pattern is not valid, an error box shows the reason. Press any key to close it.

Grep mode shows only the lines that match the search, with 2 lines before and after each match. A line of ────── separates groups that are not next to each other.

Press Ctrl + G in Text view after a search that found matches. Press Ctrl + G or Esc again to return to Text view. Switching views or reloading the file also leaves grep mode.

  • Scroll with j, k, d, u, g, and G. Page Up, Page Down, n, and N do not move grep mode.
  • Grep mode is empty after a hex byte search.

Marks let you return to a place in the file during the current session.

  • Press m, then a letter, to set a mark at the top line of the view. In the NDJSON view, the mark is set on the focused record.
  • Press ' (apostrophe), then the letter, to go back to the mark. vaste-tui places it in the middle of the view.

Marks work in Text, Hex, and NDJSON views. The letter is case-sensitive: a and A are two marks. Setting a mark again replaces it. Text view shows the mark’s letter next to the line number, for example [a].

  • Marks last until you quit. vaste-tui does not save them, and they are separate from the desktop app’s bookmarks.
  • Nothing on the screen shows that vaste-tui is waiting for the letter after m or '. Any key other than a letter cancels.
  • A mark stores a line in Text view, a byte offset in Hex view, and a record in the NDJSON view. Go back to a mark in the view where you set it: in another view, the number points somewhere else.