Skip to content

VimApi.defineOption method

VimApi › defineOption

Unofficial

Define a new Vim option with default value, type, aliases, and change callback.

Signature:

defineOption(name: string, defaultValue: unknown, type: string, aliases?: string[] | undefined, callback?: ((value: unknown, cm?: VimEditor | undefined) => void) | undefined): void

Parameters:

Parameter Type Description
name string The name of the option.
defaultValue unknown The default value for the option.
type string The type of the option.
aliases? string[] | undefined The aliases for the option.
callback? ((value: unknown, cm?: VimEditor | undefined) => void) | undefined The callback invoked when the option changes.

Returns: void