Replace a line range
nvim_edit_linesReplace a line range with new text, save to trigger formatting, and return fresh LSP diagnostics.
Instructions
Replace lines start_line..end_line (1-based, inclusive) with new text. Saves the buffer by default, so format-on-save plugins run. Returns fresh LSP diagnostics for the file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path | |
| save | No | Write the buffer, default true | |
| text | Yes | Replacement text; use \n for several lines | |
| end_line | Yes | Last line to replace, inclusive | |
| start_line | Yes | First line to replace, 1-based |