VimApi.setOption method
VimApi › setOption
Unofficial
Write a Vim option.Signature:
setOption(name: string, value: VimOptionValue, cm?: CodeMirrorEditor | undefined, cfg?: VimOptionConfig | undefined): Error | undefinedParameters:
| Parameter | Type | Description |
|---|---|---|
| name | string | The option's name. |
| value | VimOptionValue | The value to set. An option declared as a boolean takes true when this is omitted, and anything other than true or false is rejected. |
| cm? | CodeMirrorEditor | undefined | The editor to write the value to. |
| cfg? | VimOptionConfig | undefined | Which copy of the option to write. |
Returns: Error | undefined — An Error when no option of that name is registered or the value does not suit its type, otherwise nothing.
Remarks:
Whencfg.scope is unset and an editor is given, **both** the global value and that editor's own value are set. When cfg.scope is given, only that copy is written.