Skip to content

VimInputState

Unofficial

The half-typed command the key handler is assembling — the count, operator, motion and register seen so far. It is cleared once the command runs or the input is abandoned.

Import:

import type { VimInputState } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface VimInputState

Properties

PropertyTypeDescription
changeQueuenull | VimChangeQueueThe text an insert-mode binding replaced, or null when nothing is pending.
changeQueueList?(null | VimChangeQueue)[]The change queues of the other selections, when there is more than one.
keyBufferstring[]The keys typed towards the command being matched.
motionnull | stringThe name of the motion typed so far, or null when none has been.
motionArgsnull | VimMotionArgsThe arguments of the motion typed so far.
motionRepeatstring[]The digits of the count typed after the operator.
operatornull | stringThe name of the operator typed so far, or null when none has been.
operatorArgsnull | VimOperatorArgsThe arguments of the operator typed so far.
operatorShortcut?stringThe keys of a multi-key operator, which repeats by retyping only its last character.
prefixRepeatstring[]The digits of the count typed before the operator.
registerNamenull | stringThe register named for this command, or null for the unnamed register.
selectedCharacter?stringThe character typed for a command that takes one, such as f or r.

Methods

MethodReturnsDescription
getRepeat()numberResolve the typed digits into the count the command runs with.
pushRepeatDigit(n)voidAppend a digit to the count being typed, before or after the operator depending on how far the command has got.

Links to this page: