Next: , Previous: , Up: Search Commands   [Contents][Index]

4.5.3 Replace

Syntax: Replace [string]
Abbreviation: R

moves to the first match of the most recent find string or regular expression and prompts you for which action to perform. You can choose among:

Replace is mainly useful for interactive editing. ReplaceOnce, ReplaceAll and RepeatLast are more suited to macros.

If no find string was ever specified, you can enter it on the input line. If the optional argument string is not specified, you can enter it on the input line, the default being the last string used. When the last search was a regular expression search, there are some special features you can use in the replace string (see Regular Expressions) . See FindRegExp.

Note that normally a search starts just one character after the cursor. However, when Replace is invoked, the search starts at the character just under the cursor, so that you can safely Find a pattern and Replace it without having to move back.

Warning: when recording a macro with Record, there is no trace in the macro of your interaction with ne during the replacement process. When the macro is played, you will again have to choose which actions to perform. If you want to apply automatic replacement of strings for a certain number of times, you should look at ReplaceOnce, ReplaceAll, and RepeatLast.

Next: ReplaceOnce, Previous: FindRegExp, Up: Search Commands   [Contents][Index]