write_full_buf
Replace the entire content of a Neovim buffer in-memory with undo support. Provide file path and new content; buffer is created if it does not exist. Use for full file rewrites. Returns new line count.
Instructions
Replace the entire content of a Neovim buffer. The edit happens in-memory and is fully undoable — nothing is written to disk until the user saves.
file: path relative to Neovim's cwd (as shown in get_state buffers).
content: the full new text for the buffer.
Creates the buffer if it doesn't already exist. Use this when you
need to rewrite the whole file. Use find_and_replace_buf instead
for targeted edits that preserve surrounding content.
Returns {total_lines} with the new line count.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | ||
| content | Yes |