<type>documentation</type>
<domain>edit</domain>
<id>mini-search</id>
<title>Keyboard-Driven Search and Replace</title>
<date>$Date$</date>
<version>$Revision$</version>
<product>per+</product>

Keyboard-driven search and replace are available in the ``Mini-search`` sub-menu of the
``Edit`` menu. These are normally initiated with the key bindings shown in
the menu and can be controlled entirely from the keyboard. All interaction with the
mini-search manager occurs in the status area at the bottom of the IDE window.

For `keyboard personalities <ref:custom/keyboard-personalities>`__ like ``Emacs`` and
``VI/Vim``, Wing will emulate the appropriate bindings for that editor.

**Forward** and **Backward** display an initially blank search area at the bottom of the
IDE window to search in the current source editor, starting from the
current position. The search takes place as you type and can be aborted with ``Esc`` or
``Ctrl-G``, which restore the original selection and scroll position.

Searching is case-insensitive unless you enter a capital letter as part of your search
string.

To move through matches in the editor, press the key binding for the command
repeatedly. The search direction can be changed by using the key binding for the
other search direction.

When search is first initiated, pressing the key binding a second time enters the most
recent search string. When the top or bottom of the file is reached, press the key
binding again to cause the search to wrap.

While the mini-search area is visible, ``Ctrl-W`` adds the current word in the editor to
the search string. Pressing ``Ctrl-W`` repeatedly adds subsequent words.
  
**Selection Forward** and **Selection Backward** start mini-search with the current
selection in the editor.
  
**Regex Forward** and **Regex Backward** start mini-search using the search string as a
regular expression.
  
**Query/Replace** and **Query/Replace Regex** prompt for ``Search`` and ``Replace``
strings in the status area at the bottom of the IDE window. ``Tab`` moves between the
fields and ``Enter`` starts the search from the current caret position in the editor. For
each match, press ``y`` to replace or ``n`` to move on to the next match without
replacing. The interaction can be canceled with ``Esc`` or ``Ctrl-G``.

Matching is case insensitive unless a capital letter is entered as part of the search
string.

Searching is always forward and stops at the end of the file, without wrapping.

**Replace String** and **Replace Regex** work like ``Query/Replace`` but immediately
replace all matches without prompting.

When a match is visited in the editor, Wing highlights it briefly with a callout, as
configured from the ``Editor > Callouts`` preferences group.
