Insert lines
nvim_insert_linesInsert text before a specified line in a file, or append by using a line beyond the end. Saves the buffer without triggering format-on-save autocmds by default.
Instructions
Insert text before the given line, 1-based. Use a line beyond the end to append. Saves without running format-on-save autocmds by default.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Insert before this line, 1-based | |
| path | Yes | File path | |
| save | No | Write the buffer, default true | |
| text | Yes | Text to insert; use \n for several lines |