VimApi.defineOption method
VimApi › defineOption
Unofficial
Register an option that:set can read and write.Signature:
defineOption(name: string, defaultValue: boolean | null | undefined, type: "boolean", aliases?: string[] | null | undefined, callback?: VimBooleanOptionCallback | undefined): voidParameters:
| Parameter | Type | Description |
|---|---|---|
| name | string | The option's name. |
| defaultValue | boolean | null | undefined | The value the option takes until it is set. Required unless a callback is given. |
| type | "boolean" | The kind of value the option holds. |
| aliases? | string[] | null | undefined | Other names the option answers to. |
| callback? | VimBooleanOptionCallback | undefined | Invoked to read and write the option, for options not backed by a stored value. |
Returns: void
Unofficial
Register an option that:set can read and write.Signature:
defineOption(name: string, defaultValue: number | null | undefined, type: "number", aliases?: string[] | null | undefined, callback?: VimNumberOptionCallback | undefined): voidParameters:
| Parameter | Type | Description |
|---|---|---|
| name | string | The option's name. |
| defaultValue | number | null | undefined | The value the option takes until it is set. Required unless a callback is given. |
| type | "number" | The kind of value the option holds. |
| aliases? | string[] | null | undefined | Other names the option answers to. |
| callback? | VimNumberOptionCallback | undefined | Invoked to read and write the option, for options not backed by a stored value. |
Returns: void
Unofficial
Register an option that:set can read and write.Signature:
defineOption(name: string, defaultValue: string | null | undefined, type?: "string" | undefined, aliases?: string[] | null | undefined, callback?: VimStringOptionCallback | undefined): voidParameters:
| Parameter | Type | Description |
|---|---|---|
| name | string | The option's name. |
| defaultValue | string | null | undefined | The value the option takes until it is set. Required unless a callback is given. |
| type? | "string" | undefined | The kind of value the option holds. Defaults to string. |
| aliases? | string[] | null | undefined | Other names the option answers to. |
| callback? | VimStringOptionCallback | undefined | Invoked to read and write the option, for options not backed by a stored value. |
Returns: void