Tutorial: Keyboard-Driven Search and Replace

Index of All Documentation » Wing Pro Tutorial » Tutorial: Searching »


If you prefer a more powerful search interface using the keyboard only, try the key bindings listed in the Mini-search sub-menu of the Edit menu. The bindings vary according to the currently selected Keyboard Personality. This feature is not available in Wing 101.

Mini-search supports searching forward and backward in the current editor, documentation, Python Shell, Debug Console, or Debug I/O tool, optionally using the current selection in the editor as the search string, or using regular expression matching. You can also initiate replace operations.

Try this in the example1.py file: If you are using the default keyboard personality, press Ctrl-U. For other keyboard personalities, refer to Mini-search in the Edit menu.

This will display an entry area at the bottom of the IDE window and will place focus there:

/images/doc/en/intro/mini-search.png

Continue by typing G, then e, then t. Notice how Wing searches incrementally with each key press.

Search Behavior

As in toolbar search, typing only lower case letters results in case-insensitive search, while using one or more upper case letters results in case-sensitive search.

While the mini-search area is still active, try pressing the same key combination you used to display it again. Wing will search for the next matching occurrence.

If no match is found Failed Search will be displayed. After this, pressing the mini-search key combination again will wrap around and start searching at the top of the file, if there are any matches.

To start searching again using the most recently used search string, press the key combination for search twice, once to display the search entry area, and once again to recall the previous search string.

Search direction can be changed during a search session, by switching to the key bindings assigned to the desired direction.

You can exit from the search by pressing the Esc key or Ctrl-G, or with arrow keys and other editor commands.

Regular Expression Search

The regular expression search options found in Mini-search in the Edit menu work similarly but expect regular expressions for the search criteria.

Replace

Keyboard-driven mini-replace works similarly, except that you will be presented with two entry areas, one for your search string and one for the replace string.

Two replace operations are available. Both of these operate only on text that follows the caret in the file and do not wrap:

Query/Replace prompts for Y and N for each replace location

Replace String replaces all following matches in the file without prompting.

See Keyboard-Driven Search and Replace for details.