Replace exact text
nvim_edit_textReplace exact text in a file using a real Neovim instance, failing if the string is missing or ambiguous. Control saving and replace-all behavior for precise edits.
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 without running format-on-save autocmds by default. It is recommended to avoid using this tool for multi-line edits.
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 |