pub struct Buffer(_);
Expand description

A wrapper around a Neovim buffer handle.

Implementations

Shorthand for get_current_buf.

Binding to nvim_buf_attach.

Used to register a set of callbacks on specific buffer events.

Binding to nvim_buf_call.

Calls a function with this buffer as the temporary current buffer.

Binding to nvim_buf_create_user_command.

Creates a new buffer-local user command.

Binding to nvim_buf_del_keymap.

Unmaps a buffer-local mapping for the given mode.

Binding to nvim_buf_del_mark.

Deletes a named mark in the buffer.

Binding to nvim_buf_del_user_command.

Deletes a buffer-local user-command. Use del_user_command to delete a global command.

Binding to nvim_buf_del_var.

Removes a buffer-scoped (b:) variable.

Binding to nvim_buf_delete.

Deletes the buffer (not allowed while textlock is active).

Binding to nvim_buf_get_keymap.

Binding to nvim_buf_get_lines.

Gets a line range from the buffer. Indexing is zero-based, end-exclusive.

Binding to nvim_buf_get_mark.

Returns a (1-0) indexed (row, col) tuple representing the position of the named mark.

Binding to nvim_buf_get_name.

Returns the full filepath of the buffer.

Binding to nvim_buf_get_offset.

Returns the 0-indexed byte offset of a line.

Binding to nvim_buf_get_option.

Gets a buffer option value.

Binding to nvim_buf_get_text.

Gets a range from the buffer. This differs from Buffer::get_lines in that it allows retrieving only portions of a line.

Indexing is zero-based, with both row and column indices being end-exclusive.

Binding to nvim_buf_get_var.

Gets a buffer-scoped (b:) variable.

Binding to nvim_buf_is_loaded.

Checks if a buffer is valid and loaded.

Binding to nvim_buf_is_valid.

Checks if a buffer is valid.

Binding to nvim_buf_line_count.

Returns the number of lines in the given buffer.

Binding to nvim_buf_set_keymap.

Sets a buffer-local mapping for the given mode. To set a global mapping use set_keymap instead.

Binding to nvim_buf_set_lines.

Sets (replaces) a line-range in the buffer. Indexing is zero-based, end-exclusive.

Binding to nvim_buf_set_mark.

Sets a named mark in the buffer. Marks are (1,0)-indexed, and passing 0 as line deletes the mark.

Binding to nvim_buf_set_name.

Sets the full file name for a buffer.

Binding to nvim_buf_set_option.

Sets a buffer option value. Passing None as value deletes the option (only works if there’s a global fallback).

Binding to nvim_buf_set_text.

Sets (replaces) a range in the buffer. Indexing is zero-based, with both row and column indices being end-exclusive.

Binding to nvim_buf_set_var.

Sets a buffer-scoped (b:) variable.

Binding to nvim_buf_add_highlight.

Adds a highlight to the buffer. Both line and byte_range are 0-indexed.

Binding to nvim_buf_clear_namespace.

Clears namespaced objects like highlights, extmarks, or virtual text from a region.

The line range is 0-indexed.

Binding to nvim_buf_del_extmark.

Removes an extmark from the buffer.

Binding to nvim_buf_get_extmark_by_id.

The first two elements of the returned tuple represent the 0-indexed row, col position of the extmark. The last element is only present if the details option field was set to true.

Bindings to nvim_buf_get_extmarks.

Gets all the extmarks in a buffer region specified by start and end positions. Returns an iterator over (extmark_id, row, col, infos) tuples in “traversal order”. Like for Buffer::get_extmark_by_id, the infos are present only if the details option field was set to true.

Binding to nvim_buf_set_extmark.

Creates or updates an extmark. Both line and col are 0-indexed. Returns the id of the created/updated extmark.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Pops the value at the top of the stack.
Pushes all its values on the Lua stack, returning the number of values that it pushed. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.