Skip to content

VimApi.defineAction method

VimApi › defineAction

Unofficial

Register an action, which is a command that does its own work rather than waiting for a motion to give it a range. Actions may behave however they like, which makes them more flexible than motions and operators at the cost of orthogonality.

Signature:

defineAction(name: string, fn: VimActionFn): void

Parameters:

ParameterTypeDescription
namestringThe name mappings refer to the action by.
fnVimActionFnThe implementation.

Returns: void