Skip to content

VimApi.findKey method

VimApi › findKey

Unofficial

Match a key against the key map, taking any keys already buffered into account.

Signature:

findKey(cm: CodeMirrorEditor, key: string, origin?: string | undefined): (() => boolean | undefined) | undefined

Parameters:

ParameterTypeDescription
cmCodeMirrorEditorThe editor to act on.
keystringThe key that was pressed.
origin?string | undefinedWhere the key came from. mapping marks a key produced by another mapping, which keeps it out of a macro being recorded.

Returns: (() => boolean | undefined) | undefinedA function that runs the matched command, a function that does nothing when the keys so far are only a partial match, or undefined when nothing matched.