Skip to content

feat: add first-non-blank motions for ^, _, and I - #58

Open
jtams wants to merge 3 commits into
oribarilan:mainfrom
jtams:feat/first-non-blank-motions
Open

feat: add first-non-blank motions for ^, _, and I#58
jtams wants to merge 3 commits into
oribarilan:mainfrom
jtams:feat/first-non-blank-motions

Conversation

@jtams

@jtams jtams commented Jul 25, 2026

Copy link
Copy Markdown

This PR adds support for the I, _, and ^ Vim motions, all of which operate on the first non-blank character of a line.

^ was previously mapped to Home, which moves the cursor to the beginning of the line rather than the first non-blank character. This PR fixes that behavior.

It also adds support for I and _. The _ motion supports counts; for example, 3_ moves the cursor to the first non-blank character of the third line, equivalent to 2j^ in Vim.

Also adds tests covering the new behavior.

@jtams

jtams commented Jul 25, 2026

Copy link
Copy Markdown
Author

This PR resolves #18

@oribarilan

Copy link
Copy Markdown
Owner

Heads up: #62 just merged, which restructured the vim engine from a single src/vim.ts into a modular src/vim/ tree. This PR will need a rebase onto main, and the code you're touching has moved:

  • motion handling → src/vim/normal.ts
  • motion tables (MOTIONS, SELECT_MOTIONS, DELETE_MOTION) → src/vim/tables.ts
  • tests → test/vim/normal.test.ts

Also note CI is now stricter: Biome runs with noExplicitAny, noConsole, and noNonNullAssertion as errors via just check. Happy to help with the rebase if useful.

@jtams
jtams force-pushed the feat/first-non-blank-motions branch from fb1a334 to 296f116 Compare September 2, 2026 23:50
@jtams

jtams commented Sep 2, 2026

Copy link
Copy Markdown
Author

I rebased onto main and ported the changes to the new modular vim engine. Thanks for the heads up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants