Read buffer
nvim_read_bufferRead lines from a Neovim buffer using its number, file path, or current buffer. Specify a 0-based start and exclusive end, with -1 for the entire buffer.
Instructions
Read lines from a buffer (by number, path, or the current buffer). Line range is 0-based and end-exclusive; end = -1 reads to the end.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | End line (0-based, exclusive). Default -1 (end of buffer). | |
| 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. | |
| start | No | First line (0-based). Default 0. |