The search and replace command

The syntax for a search and replace command is:

    /string1/=/string2/options
This command causes stedi to search for one or more occurrences of string1 and to replace each occurrence by string2 according to the settings of the options. As with the search command, the optional parameters are a string of characters of which the last character overrides previous characters in the case of conflicts. All options of the search command can be used with this command also. In addition, there are several more options for the replace operation:

V or v

This is the Veto option, allowing the user to veto a replacement. If this option is chosen, stedi will make a replacement only after a confirmation. If string1 is found, stedi will position the cursor at the first character of the string and ask `Replace ? (G/Y/N/Q) '. If the answer `Y' or `y' is given, the replacement will be made. If the answer `N' or `n' is given, the replacement will not be made. In either case stedi will continue to search for the next match (unless > or < is one of the options). If the answer is `Q' or `q' the search and replace operation will be aborted and no more replacements will be made. The answer `G' or `g' indicates that the editor can go on now and make all further replacements.

>

With this option, searching is forward, but after the first match has occurred and the replacement has been made (unless vetoed via the V option) the command is terminated. This is called `forward search, single replace.'

$\gg$

With this option the searching is also forward, but replacements will be made until the end of the file is reached (unless vetoed via the V option). This option is called the `forward search, multiple replace' option.

<

With this option, searching is backward, but after the first match has occurred and the replacement has been made (unless vetoed via the V option) the command is terminated. This option is called the `backward search, single replace' option.

$\ll$

With this option the searching is also backward, but replacements will be made until the begin of the file is reached (unless vetoed via the V option). This is called the `backward search, multiple replace' option.

0

This option is a multiple replace option also, called the `circular search, multiple replace option'. Using this option, all occurrences of string1 in the file will be replaced by string2 unless the veto option is used.

If an option is not specified its default setting is used. This default setting is recorded among the status characters which are found on the right side of the status line. If an option is not represented among the status characters its default is off. These defaults are as follows.

The third status character can be toggled with Alt-D or Alt-E . The possible settings are:

< Backward search, single replace.
$\ll$ Backward search, multiple replace.
0 or $\infty $ Circularly forward search, multiple replace.
$\gg$ Forward search, multiple replace.
> Forward search, single replace.

The fourth status character has the following possibilities:

N
Case non-sensitive. This option is selected with Alt-N.

S
Case sensitive. This option is selected with Alt-S.

The settings of these status characters can be stored in the default file for future edit sessions.