Replace exact text
nvim_edit_textReplace an exact string in a file, optionally replacing all occurrences and saving. Fails if the text is missing or ambiguous.
Instructions
Replace an exact string in a file. Fails if the string is missing, or if it appears more than once and replace_all is false. Saves by default.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path | |
| save | No | Write the buffer, default true | |
| new_text | Yes | Replacement text | |
| old_text | Yes | Exact text to find, including indentation | |
| replace_all | No | Replace every match, default false |