Skip to content

VimApi.getOption method

VimApi › getOption

Unofficial

Read a Vim option.

Signature:

getOption(name: string, cm?: CodeMirrorEditor | undefined, cfg?: VimOptionConfig | undefined): Error | VimOptionValue

Parameters:

ParameterTypeDescription
namestringThe option's name.
cm?CodeMirrorEditor | undefinedThe editor to read the value from.
cfg?VimOptionConfig | undefinedWhich copy of the option to read.

Returns: Error | VimOptionValueThe option's value, or an Error when no option of that name is registered.

Remarks:

When cfg.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.