VimApi.getOption method
VimApi › getOption
Unofficial
Read a Vim option.Signature:
getOption(name: string, cm?: CodeMirrorEditor | undefined, cfg?: VimOptionConfig | undefined): Error | VimOptionValueParameters:
| Parameter | Type | Description |
|---|---|---|
| name | string | The option's name. |
| cm? | CodeMirrorEditor | undefined | The editor to read the value from. |
| cfg? | VimOptionConfig | undefined | Which copy of the option to read. |
Returns: Error | VimOptionValue — The option's value, or an Error when no option of that name is registered.
Remarks:
Whencfg.scope is unset and an editor is given, the editor's own value is returned, falling back to the global value when the editor has none. When cfg.scope is given, only that copy is consulted and the other is not checked.