Replacing Text

These are the methods for replacing or renaming identifiers in the current file or multiple files.

Replacing in the Current File

The Replace command searches the current file for a search pattern, and replaces the pattern with a new pat­tern. The range of replacement can be the whole file, or just the current selection. See: Replace.

Replacing in Multiple Files

The Replace Files command is similar to the Replace command, except you can specify what files you want to do the replaces in. See: Replace Files.

If you want to rename a symbol across multiple files, the Smart Rename command is usually better, because it is context sensitive. See: Smart Rename.

Renaming an Identifier

Use Smart Rename to perform context-sensitive renaming of symbols - global or local.

To rename an identifier across all project files using a smart context-sensitive method, use the Smart Rename command (Ctrl+Single-Quote). Smart Rename is a context-sensitive form of a global Search and Replace. See: Smart Rename. Source Insight's search index makes the search very fast. This is the easiest way to replace a single word identifier with a new string. In addition, you can have Source Insight produce a log of replacements in the Search Results window. Each replacement line is listed, along with a source link to the location of each line that was changed.

Smart Rename is also excellent for renaming local scope variables.