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?: null | string[], callback?: VimBooleanOptionCallback): 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? | null | string[] | Other names the option answers to. |
| callback? | VimBooleanOptionCallback | 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?: null | string[], callback?: VimNumberOptionCallback): 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? | null | string[] | Other names the option answers to. |
| callback? | VimNumberOptionCallback | 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', aliases?: null | string[], callback?: VimStringOptionCallback): 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' | The kind of value the option holds. Defaults to string. |
| aliases? | null | string[] | Other names the option answers to. |
| callback? | VimStringOptionCallback | Invoked to read and write the option, for options not backed by a stored value. |
Returns: void