Creating Virtual Buffers
createVirtualBufferInSplit
Create a virtual buffer in a new split below the current pane.CreateVirtualBufferOptions
required
Buffer configuration object
Promise<CreateVirtualBufferResult>
Result containing buffer_id and optional split_id
The
panel_id enables idempotent updates: if a panel with that ID exists, its content is replaced instead of creating a new split. Define the mode with defineMode first.createVirtualBufferInExistingSplit
Create a virtual buffer in an existing split.CreateVirtualBufferInExistingSplitOptions
required
Configuration for the virtual buffer
Promise<number>
The created buffer ID
createVirtualBuffer
Create a virtual buffer in the current split as a new tab.CreateVirtualBufferInCurrentSplitOptions
required
Configuration for the virtual buffer
Promise<number>
The created buffer ID
Managing Virtual Buffers
setVirtualBufferContent
Set the content of a virtual buffer with text properties.number
required
ID of the virtual buffer
TextPropertyEntry[]
required
Array of text entries with properties
boolean
true if content was set successfullygetTextPropertiesAtCursor
Get text properties at the cursor position in a buffer.number
required
ID of the buffer to query
Record<string, unknown>[]
Array of property objects at cursor position
Modes and Keybindings
defineMode
Define a buffer mode with keybindings.string
required
Mode name (e.g., “diagnostics-list”)
string
required
Parent mode name for inheritance (e.g., “special”), or null
[string, string][]
required
Array of [key_string, command_name] pairs
boolean
required
Whether buffers in this mode are read-only
boolean
true if mode was defined successfullySplit Management
getActiveSplitId
Get the ID of the focused split pane.number
Active split ID
focusSplit
Focus a specific split.number
required
ID of the split to focus
boolean
true if successfulsetSplitBuffer
Set the buffer displayed in a specific split.number
required
ID of the split
number
required
ID of the buffer to display
boolean
true if successfulcloseSplit
Close a split (if not the last one).number
required
ID of the split to close
boolean
true if successfulsetSplitRatio
Set the ratio of a split container.number
required
ID of the split
number
required
Ratio between 0.0 and 1.0 (0.5 = equal split)
boolean
true if successfuldistributeSplitsEvenly
Distribute all visible splits evenly.boolean
true if successful