diff --git a/src/Mappers/SpecialKeys/Motion.ts b/src/Mappers/SpecialKeys/Motion.ts index afb9252..6cc967b 100644 --- a/src/Mappers/SpecialKeys/Motion.ts +++ b/src/Mappers/SpecialKeys/Motion.ts @@ -95,8 +95,10 @@ export class SpecialKeyMotion extends GenericMapper implements SpecialKeyCommon { keys: '0', motionGenerators: [MotionLine.start] }, { keys: '$', motionGenerators: [MotionLine.end] }, + { keys: 'g ^', motionGenerators: [MotionWrappedLine.firstNonBlank] }, { keys: 'g 0', motionGenerators: [MotionWrappedLine.start] }, { keys: 'g $', motionGenerators: [MotionWrappedLine.end] }, + { keys: 'g m', motionGenerators: [MotionWrappedLine.middle] }, { keys: 'g k', motionGenerators: [MotionWrappedLine.up] }, { keys: 'g j', motionGenerators: [MotionWrappedLine.down] }, diff --git a/src/Motions/WrappedLine.ts b/src/Motions/WrappedLine.ts index d0425fa..840aa19 100644 --- a/src/Motions/WrappedLine.ts +++ b/src/Motions/WrappedLine.ts @@ -13,6 +13,14 @@ export class MotionWrappedLine extends Motion { this.cursorMove = args.cursorMove; } + static firstNonBlank(): Motion { + return new MotionWrappedLine({ + cursorMove: { + to: 'wrappedLineFirstNonWhitespaceCharacter', + }, + }); + } + static start(): Motion { return new MotionWrappedLine({ cursorMove: { @@ -29,6 +37,14 @@ export class MotionWrappedLine extends Motion { }); } + static middle(): Motion { + return new MotionWrappedLine({ + cursorMove: { + to: 'wrappedLineColumnCenter', + }, + }); + } + static up(args: { n?: number } = {}): Motion { return new MotionWrappedLine({ isLinewise: true,