1 Find and Replace
liquibyte edited this page 2026-11-19 16:23:30 -06:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Find and Replace

How to search and replace text in Unryu: in the current document, in every open document, and in the files of a folder. This page covers the Find, Replace and Find in Files dialogs and every option in them, the whole Search menu, regular expressions, the results in the message window, and the settings that Unryu remembers.

1. The search tools at a glance

Unryu has several ways to search. Pick the one that fits what you want to do:

You want to Use Keys
Find the next or previous match of a text in the current document Search > Find..., then Next or Previous Ctrl+F, then Enter / Shift+Enter
Repeat the last search without opening the dialog Search > Find Next / Find Previous Ctrl+G / Ctrl+Shift+G, or F3 / Shift+F3
Jump to the next place where the selected word appears Search > More > Find Next Selection / Find Previous Selection Ctrl+F3 / Ctrl+Shift+F3
Replace text, one match at a time or all at once Search > Replace... Ctrl+H
See a list of every line that matches, in one or all open documents Find dialog > Find All > In Document / In Session Alt+I / Alt+O in the dialog
Highlight every match in the document Find dialog > Find All > Mark, or Search > More > Mark All Alt+M in the dialog, Ctrl+Shift+M
List every use of the word at the cursor Search > More > Find Usage / Find Document Usage Ctrl+Shift+E / Ctrl+Shift+D
Search the files of a folder, also files that are not open Search > Find in Files... Ctrl+Shift+F
Search while you type The Find field on the toolbar click the field, type, Enter

These are the default keys. You can change most of them in Preferences > Keybindings. F3 and Shift+F3, Ctrl+F3 and Ctrl+Shift+F3, Ctrl+Shift+E, Ctrl+Shift+D and Ctrl+Shift+M, and the other items of Search > More, are fixed, and Stop Find in Files has no key and cannot be given one; see Keyboard shortcuts for the full list.

2. The Find dialog

Open it with Search > Find... or Ctrl+F. The dialog is a separate small window that does not block the editor: you can leave it open, click in the document, edit, and come back to it. The first time it opens near the top right corner of the main window. After that it opens where you last left it, also after a restart.

When the dialog opens, the Search for field is filled in for you:

  • If text is selected in the document (on one line), the field gets the selected text.
  • If nothing is selected and Preferences > General > Miscellaneous > "Use the current word under the cursor for Find dialogs" is on (the default), the field gets the word at the cursor. A word is made of letters, digits and the underscore.
  • Otherwise the field keeps the text of your last search.

The text in the field is selected, so you can type over it at once.

Layout of the Find dialog with the Find All row open

The Find dialog with the Find All row open. Grey options cannot be chosen with the current combination of options. Find has no "Search backwards" option: the Previous button searches back.

The controls of the Find dialog

Control Key What it does
Search for Alt+S The text or regular expression to find, up to 65,535 bytes long.
▾ (at the right of the field) Alt+Down Opens a list of the last 10 texts you searched for, the newest first. Choose one to put it in the field. A text goes into the list only when a search with it was carried out.
Use regular expressions Alt+U The text is a regular expression (section 7), not plain text.
Use multi-line matching Alt+G Only with regular expressions: a match may go over line ends (section 7).
Use escape sequences Alt+E Only for plain text: \n, \t and the others mean the characters they name (section 8).
Case sensitive Alt+A Upper and lower case must be as typed.
Match only a whole word Alt+W Only for plain text: the match must be a whole word.
Match from start of word Alt+T Only for plain text: the match must start a word.
▸ Find All Alt+F Opens or closes the Find All row. Unryu remembers whether it is open.
Close dialog Alt+D When on (the default), the dialog closes after Mark, In Session or In Document.
Mark Alt+M Highlights every match in the current document (section 9).
In Session Alt+O Lists every matching line of every open document in the message window (section 9).
In Document Alt+I Lists every matching line of the current document in the message window.
Close Escape Closes the dialog. The keyboard goes back to the editor.
Previous Alt+P, Shift+Enter, Shift+F3 Finds the match before the selection (section 5).
Next Alt+N, Enter, F3 Finds the match after the selection. This is the default button.

The Alt keys of the Find All row work only while the row is open. The Alt key of a greyed option does nothing. Inside the dialog, Ctrl+H changes it to the Replace dialog and Ctrl+F changes it back. The window manager's close button closes the dialog, as Close does.

The line at the left of the buttons tells what the last action did, for example "x" was not found., Wrapped around to the start. or Found 5 matches for "x". It is empty each time the dialog opens. The same text also appears in the status bar.

3. The Replace dialog

Open it with Search > Replace... or Ctrl+H. It is the Find dialog with a second field and other buttons. The Search for field is filled in the same way as in Find (section 2).

Layout of the Replace dialog with the Replace All row open

The Replace dialog with the Replace All row open. Replace keeps its own options, histories, Close dialog check, open or closed row and window position, separate from those of Find.

The controls of the Replace dialog

Control Key What it does
Search for Alt+S The text or expression to find. Its own history of 10 (▾ or Alt+Down).
Replace with Alt+H What each match becomes. It can be empty: then the matches are deleted. It has its own history of 10. In a regular expression replacement, \0 to \9 insert parts of the match (section 8).
The options Alt+U Alt+G Alt+E Alt+A Alt+W Alt+T The same as in the Find dialog (section 4).
Search backwards Alt+B Find, Replace and Replace & Find move towards the start of the document instead of the end.
▸ Replace All Alt+P Opens or closes the Replace All row.
Close dialog Alt+D When on (the default), the dialog closes after In Session, In Document or In Selection.
In Session Alt+O Replaces every match in every open document, after a question (section 10).
In Document Alt+I Replaces every match in the current document.
In Selection Alt+L Replaces every match inside the selected text only.
Close Escape Closes the dialog.
Find Alt+F, Enter in Search for, F3 Finds the next match (or the one before, with Search backwards) and selects it, without replacing anything.
Replace Alt+R If the selection is a match, it is replaced, and Replace does not move on to the next one. If the selection is not a match (or nothing is selected), Replace only finds and selects the next match, so you can look at it first and press Replace again.
Replace & Find Alt+N, Enter in Replace with Replaces the selected match, if it is one, and then finds the next match. Press it again and again to step through the document, replacing as you go. This is the default button.

Shift+F3 in the Replace dialog searches in the direction opposite to Search backwards. Shift+Enter does the same as Enter here. Inside the dialog, Ctrl+F changes it to the Find dialog and Ctrl+H changes it back; each keeps its own Search for text.

When Case sensitive is on, "Use regular expressions" is off, and the Replace with text is the same as the Search for text, a replacement would change nothing. Then Replace, Replace & Find and all the Replace All buttons only beep (if beeping is on) and do nothing.

4. The search options

The options are the same in the Find and Replace dialogs, but each dialog keeps its own settings.

Option Meaning
Case sensitive When off (the default), Name, name and NAME all match, and so do the letters of every language: É and é, Σ, σ and ς, Ä and ä. Plain text compares each character by Unicode's case folding, so a match can even differ in length from the text you typed (the Kelvin sign K matches k). Regular expressions ignore case for every letter as well.
Match only a whole word The match must not have a word character directly before or after it. Searching count then finds count but not counter or recount. Word characters are letters, digits, the underscore, and every non-ASCII character.
Match from start of word The match must not have a word character directly before it, but may go on into a longer word: count finds count and counter, but not recount. It is greyed while "Match only a whole word" is on, because a whole word already starts a word.
Use regular expressions The Search for text is a regular expression (section 7). While it is on, "Use escape sequences", "Match only a whole word" and "Match from start of word" are greyed and ignored: a regular expression has its own escapes and its own word anchors (\b, \<, \>).
Use multi-line matching Can be chosen only while "Use regular expressions" is on. Lets a match go across line ends (section 7).
Use escape sequences For plain text: lets you type special characters such as a tab or a line end (section 8). A plain-text search with \n in it can find text across a line end.
Search backwards Replace dialog only: Find, Replace and Replace & Find move towards the start of the document.

A greyed option keeps its check mark, so when you switch regular expressions off again the options come back as they were.

5. Find Next and Find Previous

Next, Previous, Find, Replace & Find, the toolbar's Find field, and the menu items Find Next and Find Previous all search in the same way.

  • Where the search starts. Find Next starts at the end of the selection (or at the cursor) and goes towards the end of the document. Find Previous starts at the beginning of the selection and goes towards the start. So pressing Next again and again steps from one match to the next.
  • A match is found. It is selected and scrolled into view. The keyboard stays where it was, so you can keep pressing Enter in the dialog.
  • The end of the document is reached. If the search did not start at the very top (for Next) or the very end (for Previous), Unryu asks: "x" was not found. Wrap search and find again? Choose Find to go on from the other end of the document, or Cancel to stop. The Find or Replace dialog is hidden while the question is open. After Find it comes back; after Cancel it stays closed and the keyboard goes to the editor. When the search wraps, the dialog and the status bar say "Wrapped around to the start." (or "to the end.").
  • Always wrap search. With Preferences > General > Miscellaneous > "Always wrap search" on, Unryu does not ask; it wraps at once. This preference is off by default.
  • Nothing is found. The message is "x" was not found., Unryu beeps, and the Search for field turns red. It turns normal again as soon as you change the text, choose one from the history, or open the dialog again.
  • The text cannot be searched for. If the field is empty ("Nothing to search for.") or the regular expression is wrong ("Bad regex: ..." with the reason), Unryu beeps, shows the reason, and puts the keyboard back in the Search for field. The dialog stays open.

A match is never empty. A regular expression that can match nothing at all, such as ^ on its own or x*, only finds places where it matches at least one character. This keeps Next from standing still.

What happens when you press Next

Find Next step by step. Find Previous is the same with "start" and "end" swapped.

Find Next and Find Previous without the dialog

Search > Find Next (Ctrl+G or F3) and Search > Find Previous (Ctrl+Shift+G or Shift+F3) repeat the search with the text and the options of the Find dialog, whether the dialog is open or closed. They use the Find dialog's settings even when you last worked in the Replace dialog. If the Find dialog has no text yet, they open the Find dialog instead.

6. When the dialog closes by itself

Some actions close the dialog when they are done, so you can go on working in the document. When it closes, the keyboard goes back to the editor. The dialog remembers where it was on the screen and opens there the next time.

Dialog Action The dialog closes when
Find Next, Previous Preferences > General > Miscellaneous > "Hide the Find dialog" is on (it is off by default)
Find Mark, In Session, In Document "Close dialog" is on (it is on by default)
Replace In Session, In Document, In Selection "Close dialog" is on (it is on by default)
Replace Find, Replace, Replace & Find never
Both Close, Escape, the window's close button always
Both an action that cannot run (empty field, bad regular expression, replacing a text with itself) never: the dialog stays and the Search for field gets the keyboard

7. Regular expressions

With "Use regular expressions" on, the Search for text is a POSIX extended regular expression, the kind that grep -E uses. Most simple expressions from other editors work the same. Unryu also understands a few shortcuts that people often type. Regular expressions work on bytes: . and a bracket such as [^x] match one byte, so a letter outside ASCII (é, ü, a Chinese character) counts as two to four of them. \w, \b, \<, \> and the character classes know only the ASCII letters. This is what you can use:

Write To match
. any one character except a line end
[abc], [a-z], [^0-9] one character from the set, or (with ^) not from the set
[[:space:]], [[:digit:]], [[:alpha:]], [[:alnum:]], [[:upper:]], [[:lower:]], [[:punct:]] the POSIX character classes, inside brackets
*, +, ?, {2}, {2,5} the item before it: zero or more, one or more, zero or one, exactly 2, 2 to 5 times
`a b`
( ) a group; the replacement can use it as \1 to \9
^, $ the start and the end of a line
\b, \B, \<, \> a word boundary, not a word boundary, the start of a word, the end of a word
\w, \W, \s, \S a word character or not, a space character or not (outside brackets only; inside brackets use [:alnum:]_ or [:space:])
\d, \D a digit or not a digit (Unryu turns these into [0-9] and [^0-9]; they work outside brackets only)
\n, \t, \r a line end, a tab, a carriage return (also inside brackets)
\., \(, \[, \\ ... the character itself, without its special meaning

Things that other regular expression engines have and that do not work here: lazy repeats such as *?, look-ahead and look-behind such as (?=...), \d inside brackets, and \xNN character codes. Use the character itself, or a bracket expression, instead.

"Case sensitive" works with regular expressions too. "Match only a whole word" and "Match from start of word" do not: use \b, \< and \> in the expression instead.

One line at a time, or multi-line

Normally Unryu matches a regular expression against one line at a time, so a match never goes over a line end. Turn on "Use multi-line matching" to let a match continue onto the next lines. Even in multi-line mode, ^ and $ still mean the start and end of each line, and . still does not match a line end. To cross a line end, write it: \n or [[:space:]].

The same expression with and without multi-line matching

Multi-line matching lets the match run over the line end between the two lines.

8. Escape sequences and replacement texts

Plain text with "Use escape sequences"

When "Use escape sequences" is on (and regular expressions are off), these sequences in the Search for and the Replace with fields stand for special characters:

Write For
\n a line end
\t a tab
\r a carriage return
\\ one backslash
\xNN the byte with the two-digit hexadecimal code NN, for example \x41 for A

A backslash before any other character stays as typed. With the option off, every backslash is an ordinary character. Example: search for ;\n} to find a semicolon at the end of a line that is followed by a closing brace at the start of the next line.

The replacement of a regular expression

With regular expressions on, the Replace with text can use parts of what was matched:

Write To insert
\0 the whole match
\1 to \9 what the first to ninth group ( ) matched; nothing if that group took no part in the match
\n, \t, \r a line end, a tab, a carriage return
\\ one backslash
\ and any other character that character

Example: search for (\w+) = (\w+); and replace with \2 = \1; to swap the two sides of each assignment.

9. Find All, Mark, and the results in the message window

In Document and In Session

In the Find dialog, open the Find All row and choose In Document (Alt+I) to list every match in the current document, or In Session (Alt+O) to list every match in all open documents. The results go to the Messages tab of the message window at the bottom of the main window (see The Window). If the message window is hidden, it is shown.

  • Each line that has a match gets one row: name:line: text, where name is the file name ("untitled" for a document that was never saved) and text is the line without the spaces at its ends (at most 400 characters). The matched text is highlighted in the row. A line with several matches is listed only once.
  • The last row is the summary, for example Found 5 matches for "hex_value". or No matches found for "x". The count is the number of matches, not of lines.
  • Each new Find All clears the earlier results from Messages.

The main window with results in the Messages tab

The results of In Document in the Messages tab. Click a row to go to that match. View > Show Message Window shows and hides the message window.

Going to a result

  • Click a row to go to its match: Unryu switches to the document and selects the match. The jump is recorded, so Navigate > Back (Alt+Left) brings you back to where you were.
  • The rows follow your edits. When you type or delete above a match after the search, its row still goes to that match. When you edit the match itself, its row leads nowhere: a click says "The text of this row was changed since the search."
  • If you closed the document since the search, Unryu opens the file again at that line. A document that was never saved cannot be opened again; the status bar says "The document has been closed."
  • Search > Next Message and Search > Previous Message select the next or previous result row and go to it, so you can walk through the results from the keyboard. At the last (or first) result, they beep. These items have no default key; you can give them one in Preferences > Keybindings.

Mark

Mark (Alt+M) in the Find All row highlights every match in the current document with the theme's search mark color, and reports the count, for example Found 3 matches for "x". The marks follow the text: when you edit, the matches are found again, so new matches get marked and changed ones lose their mark. The marks stay until you choose Search > Clear Marks, mark something else, or switch to another document. The colors are the search-mark and search-mark-text items of the editor theme (see Themes).

Find Usage and Find Document Usage

Search > More > Find Usage (Ctrl+Shift+E), with the cursor on a name of code and nothing selected, lists every place that means that name, across the whole project, by what Unryu understands of the code (Code analysis):

  • In this document, the places that name the same thing: a local variable named i in another function is not listed.
  • When the name is this document's own (a local, a parameter, or a static function or variable), only this document.
  • Otherwise also every file of the project (from the project index) that uses the name, and the file that defines it. A file that defines a thing of the same name of its own is left out: that is another thing.
  • While a workbench is open (Files), the files of its other projects too, after the project in front's. Their lines in Messages start with their project's name, so a name defined in two copies of the same code shows which copy each place is in.

Each place is a line in Messages: the file, the line, and the line's text with the name marked; choosing it opens the file there. The summary says how many places in how many files mean the name. Otherwise (a selection, or no name of code at the cursor) Find Usage lists every use of the text in all open documents; Find Document Usage (Ctrl+Shift+D) does that for the current document only. These work like In Session and In Document, without the dialog:

  • With a selection (on one line), they search for the selected text exactly as written, case sensitive.
  • Without a selection, they search for the word at the cursor as a whole word, case sensitive.
  • If there is no selection and no word at the cursor, they beep.

Rename Symbol

Search > More > Rename Symbol... renames the name at the cursor everywhere Find Usage would list it. It asks for the new name (letters, digits and _, not starting with a digit), then says how many places in how many files it will change and asks again. Open documents are edited, and one Undo in each takes it back; files that are not open are written at once, and Undo does not reach them. An open document with unsaved changes (other than the one in front) is left out: save it first. A place where the name is no longer written (the file changed since it was read) is left as it is; the status bar says how many places were renamed and how many were left.

The symbol popup that appears over a name also offers these searches: its "all N uses, in Messages" link runs Find Document Usage on that name, and when a project is open, its "in the project ..., in Messages" link runs a Find in Files for the name over the whole project folder (see Analysis).

10. Replace All

The Replace All row of the Replace dialog replaces every match at once:

  • In Document (Alt+I) replaces every match in the current document.
  • In Selection (Alt+L) replaces every match that lies completely inside the selection. Afterwards the selection covers the changed text. With nothing selected, nothing is replaced.
  • In Session (Alt+O) replaces every match in every open document. Because it can change many files, Unryu first asks: Are you sure to replace in the whole session? This operation will modify all open files which contain the text to replace. Choose Replace to go on or Cancel to stop. With Close dialog on, the dialog closes also when you choose Cancel.

In each document, all the replacements together are one edit: one Undo (Ctrl+Z) in that document takes them all back. The view does not jump: the cursor and the scroll position stay where they were. A document that changed gets the * on its tab and its recovery copy is updated, as after any edit (see Files and Recovery). Nothing is saved to disk until you save.

For each document that changed, the Status tab of the message window gets a line such as b.c: replaced 15 occurrences of "byte" with "octet". After In Session, Unryu shows the Status tab, so you can see which documents changed. When more than one changed, the status bar and the dialog show a total such as Replaced 17 matches in 2 documents. When nothing matched, the message is No matches found for "x". and Unryu beeps.

In Session stops a compiler check that is running on the current document before it starts (see Safety), because the check reads the text that is being replaced.

11. Find in Files

Search > Find in Files... (Ctrl+Shift+F) searches the files of a folder on disk, including files that are not open. The results go to the Messages tab, where a click opens the file at the match.

Layout of the Find in Files dialog

The Find in Files dialog. A field that stops the search (an empty text, a bad regular expression, a folder that does not exist) turns red until you type in it.

The fields and options

Control Key What it does
Search for Alt+S The text or regular expression to find. It is filled in from the selection or the word at the cursor, as in the Find dialog.
File patterns: all / custom (click it) It has no key of its own, and Tab does not reach it. "all" searches every file. "custom" searches only files whose name fits one of the patterns. Choosing "custom" puts the keyboard in the patterns field.
The patterns Alt+P (custom only) Shell-style patterns separated by spaces, such as *.c *.h or Makefile *.mk. * stands for any text, ? for any one character, [abc] for one of those characters. A pattern is compared with the file's name only, not its folder. Up to 64 patterns. The field has its own history of 10.
Directory Alt+D The folder to search. It has its own history of 10.
... Opens a "Select Folder" dialog that starts at the folder in the Directory field, and puts the chosen folder into the field.
Encoding Alt+N The character encoding of the files. Each file is converted from this encoding before it is searched, so you can search files in, say, ISO-8859-1 with text typed normally. The list is grouped by region. "Without encoding" reads the bytes as they are. The default is UTF-8. A file that cannot be converted from the chosen encoding is skipped.
Use regular expressions Alt+U The text is a regular expression, as in section 7. Each line is searched on its own, as grep does, so there is no multi-line mode and no escape sequences option here (Geany's Find in Files has neither).
Invert search results Alt+I Lists the lines that do not match, like grep -v.
Recurse in subfolders Alt+R Also searches every folder below the directory, not only the directory itself.
Case sensitive Alt+A Upper and lower case must be as typed. On by default.
Match only a whole word Alt+W The match must be a whole word.
Extra options Alt+X More options for the grep program of Preferences > Tools > Grep, such as -P or --exclude-dir=build. The check turns them on; the field holds them. Both are greyed when no grep program is set, since Unryu then searches by itself. See "Using an external grep program" below.
Cancel Escape Closes the dialog without searching.
Find Enter Starts the search and closes the dialog.

Tab and Shift+Tab move between the text fields (the patterns field only in "custom"). Alt+Down opens the history of the field that has the keyboard. Alt+N opens the Encoding list (so does a click). While it is open, Up, Down, Home and End move in it, Enter takes the encoding, and Escape closes the list without a change. Either way the keyboard goes back to the text field.

Where the search looks

When the dialog opens, the Directory field is filled in like this:

  • With Preferences > General > Miscellaneous > "Use the current file's directory for Find in Files" on (the default), it is the folder of the current document, if that document has been saved.
  • Otherwise the field keeps the folder of your last search. The first time, it is the folder Unryu was started in.

If the Directory field is empty, the keyboard starts there; otherwise it starts in Search for.

Unryu reads the files itself, in a background thread, so the editor stays responsive during a long search. In each folder it searches the files first, in name order, and then the folders below it (with Recurse). It skips:

  • symbolic links, both to files and to folders (so a link that points back up cannot make the search run forever);
  • folders it may not read;
  • files larger than 256 MB;
  • files that are not text: a file that contains a NUL byte is treated as binary, like grep -I does;
  • with an encoding other than UTF-8, files that cannot be converted from it (with UTF-8, files are read as they are);
  • folders more than 64 levels below the directory.

Each line is searched on its own, so a match never goes over a line end, and ^ and $ are the start and end of the line. A UTF-8 byte order mark at the start of a file is ignored.

The results

When the search starts, the dialog closes and the Messages tab is cleared and shown, with a first row such as Searching for "x" in *.c *.h (in directory: /home/me/project). The status bar says "Searching...". Results appear as they are found, one row for each matching line: path:line:text. The path is relative to the searched directory, the text is the line without the spaces at its ends (at most 399 bytes of it), and the match is highlighted. With Invert search results, the rows have no highlight.

At the end comes a summary row: Search completed with N matches. (N counts lines), No matches found., or, with an external grep that cannot be started, Cannot execute grep tool "...". Unryu beeps when the search ends, if beeping is on.

You can look at another tab of the message window while the search runs. The label of the Messages tab then shows the state: the theme's tab-running color (blue by default) while the search runs, and its tab-success color when it ended with matches. The color goes away when you look at the tab again.

Click a row to open the file (or switch to its tab if it is already open) at that line. If the line is still long enough, the columns where the match was are selected (also when the text there has changed since). Search > Next Message and Previous Message step through the rows, as for Find All.

If the search cannot start, the dialog stays open, Unryu beeps, and the field at fault turns red:

  • the Directory field, with "Invalid directory for Find in Files." in the status bar, when the folder does not exist;
  • the Search for field, with "No text to find." when it is empty, or with the reason when the regular expression is wrong.

Search > Stop Find in Files stops a search that is still running, and keeps what it found so far. Starting a new Find in Files stops one that is still running too, and so does quitting Unryu.

Using an external grep program

Normally Unryu searches the files itself. If you prefer a grep program, enter it in Preferences > Tools > Tool paths > Grep:, for example grep or /usr/bin/grep. The field is empty by default, which means "Unryu searches by itself". With a program set, Find in Files runs it in the searched directory, directly and without a shell, so the search text is always passed as plain text and never interpreted by a shell. Unryu gives it these arguments:

  • -nHIZ always (line numbers, file names, skip binary files, a NUL after each file name);
  • -i when Case sensitive is off, -w for a whole word, -v for Invert, -r for Recurse;
  • -E for a regular expression, otherwise -F (plain text);
  • the Extra options, when that check is on: split into words as a shell would split them (' and " quote, \ takes the next character as it is), but given to the program directly, so nothing in them can run a command. They come after Unryu's own options, so they can change them;
  • --include=PATTERN for each file pattern;
  • --, the search text, and then . with Recurse, or else the names of the files in the directory (at most about 4000 of them).

The program's own words can include options, separated by spaces (up to 16 words; quotes are not understood). Its output is converted from the chosen encoding. Unryu finds the column of each match again with its own search, to highlight it; where grep and Unryu disagree (for example on \d, which Unryu understands but grep -E may not), the line is still listed, without a highlight. When the search stops, Unryu stops the program.

12. The Search menu

Item Default key What it does
Find... Ctrl+F Opens the Find dialog (section 2).
Find Next Ctrl+G, F3 Finds the next match of the Find dialog's text, with its options (section 5).
Find Previous Ctrl+Shift+G, Shift+F3 Finds the match before.
Find in Files... Ctrl+Shift+F Opens the Find in Files dialog (section 11).
Stop Find in Files none Stops a Find in Files search that is still running. The results found so far stay in the Messages tab, and the last row says "Search stopped after N matches." Greyed while no search runs.
Replace... Ctrl+H Opens the Replace dialog (section 3).
Next Message none Goes to the next result row in the Messages tab (section 9).
Previous Message none Goes to the result row before.
Go to Next Marker Ctrl+. Moves the cursor to the start of the next line that has a bookmark. Beeps when there is none.
Go to Previous Marker Ctrl+, Moves to the bookmarked line before.
Go to Line... Ctrl+L Asks for a line number and moves the cursor to the start of that line.
More ▸ Find Next Selection Ctrl+F3 Finds the next place where the selected text, or else the word at the cursor, appears. It ignores the dialog's options: plain text, any case, not only whole words. At the end of the document it wraps, or asks, as Find Next does (section 5). Beeps when there is nothing to search for.
More ▸ Find Previous Selection Ctrl+Shift+F3 The same, towards the start.
More ▸ Find Usage Ctrl+Shift+E Lists the places that mean the name at the cursor, across the project; with a selection, its uses in all open documents (section 9).
More ▸ Rename Symbol... Renames the name at the cursor wherever Find Usage lists it (section 9).
More ▸ Find Document Usage Ctrl+Shift+D The same, in the current document only.
More ▸ Mark All Ctrl+Shift+M Marks every place of the selected text (as written) or of the word at the cursor (as a whole word), case sensitive, like Mark. With the cursor on a marked match, it clears the marks instead, so the same key turns the marks on and off. With nothing at the cursor, it clears the marks.
More ▸ Go to Symbol Definition Ctrl+T Goes to where the name at the cursor is defined (see Analysis).
More ▸ Go to Symbol Declaration Ctrl+Shift+T Goes to where it is declared.
Clear Marks none Removes the highlighting of Mark and Mark All.

Markers. A marker is a bookmark on a line. Ctrl+M (Toggle Marker, listed under Search in Preferences > Keybindings) puts one on the cursor's line or takes it off; a click in the markers margin does the same. Document > Remove Markers removes them all. See Editing for markers, the markers margin and the change history.

Go to Line. The dialog remembers the last line you entered while Unryu runs. Besides a line number you can enter +N or -N to move N lines down or up from the cursor's line. A number past the end goes to the last line. The jump is recorded for Navigate > Back and Forward. The toolbar has its own Go to line field that works the same way. See Editing for Back and Forward.

The Find field on the toolbar

The toolbar has a Find field and a Find button (they are in the default toolbar). Type in the field and Unryu searches as you type: the match grows in place with each letter. Enter or the Find button finds the next match. Escape puts the keyboard back in the editor. The toolbar search is always plain text, ignores case, and wraps around the end of the document without asking. Nothing is found: the status bar says so and Unryu beeps. A Replace button can be added to the toolbar; it opens the Replace dialog. See The Window for the toolbar and how to change it.

13. Settings that are remembered

In Preferences

Preference Default Meaning
General > Miscellaneous > Search > Always wrap search off At the end of the document, go on from the other end without asking.
General > Miscellaneous > Search > Hide the Find dialog off Close the Find dialog after Next and Previous.
General > Miscellaneous > Search > Use the current word under the cursor for Find dialogs on Fill in Search for with the word at the cursor when nothing is selected (Find, Replace and Find in Files).
General > Miscellaneous > Search > Use the current file's directory for Find in Files on Open Find in Files on the folder of the current file.
General > Miscellaneous > Beep on errors or when compilation has finished on Beep when a search finds nothing, when an action cannot be done, and when Find in Files ends.
Tools > Tool paths > Grep: empty The grep program for Find in Files. Empty: Unryu searches by itself.
Various > fif-encoding UTF-8 The encoding that the Find in Files dialog starts with. It also changes when you choose another encoding in the dialog. Enter a name from the Encoding list, such as UTF-8 or ISO-8859-1; a name Unryu does not know is refused.

Kept by the dialogs

The dialogs remember their options when you close them and after a restart. Unryu writes them to unryu.conf when it quits. You do not need to edit these keys by hand; they are listed so you know what is kept.

Key in unryu.conf Default Meaning
find-case, find-whole-word, find-word-start, find-regex, find-multiline, find-escapes 0 The options of the Find dialog. (find-backwards is written too, but has no effect: Find has no Search backwards option.)
replace-case, replace-whole-word, replace-word-start, replace-regex, replace-multiline, replace-escapes, replace-backwards 0 The options of the Replace dialog.
find-close-dialog, replace-close-dialog 1 The "Close dialog" check of each dialog.
find-expanded, replace-expanded 0 Whether the Find All / Replace All row is open.
find-position, replace-position, fif-position none Where each dialog was on the screen.
fif-case 1 Find in Files: Case sensitive.
fif-whole-word, fif-regex, fif-invert, fif-recursive 0 Find in Files: the other options.
fif-files-mode, fif-patterns 0, empty Find in Files: "all" (0) or "custom" (2), and the custom patterns.
fif-encoding UTF-8 Find in Files: the encoding.
fif-extra, fif-extra-options 0, empty Find in Files: the Extra options check, and its text.
always-wrap-search, hide-find-dialog, search-use-current-word, fif-current-dir, beep-on-errors, tool-grep The preferences in the table above.

The texts themselves are not kept after a restart: Search for, Replace with, the Find in Files texts and directory, and all the history lists start empty each time Unryu starts. While Unryu runs, each dialog keeps its last texts and its histories.