Write buffer lines
nvim_write_bufferReplace a line range in an open Neovim buffer with new lines. Use zero-based start and end indices; set start=0 and end=-1 to overwrite the entire buffer.
Instructions
Replace a line range in a buffer with new lines. Line range is 0-based and end-exclusive; use start = 0, end = -1 to replace the whole buffer.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"lines": "<lines>"
},
"name": "nvim_write_buffer"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | End line (0-based, exclusive). Default -1 (replace to end). | |
| path | No | Target buffer by file path (must already be open). Ignored if bufnr is set. | |
| bufnr | No | Target buffer number. Omit to use the path or the current buffer. | |
| lines | Yes | Replacement lines (no trailing newlines). | |
| start | No | First line to replace (0-based). Default 0. |