Skip to content

feat: copy mode#19

Merged
leohenon merged 37 commits intovimfrom
feat/copy-mode
Mar 24, 2026
Merged

feat: copy mode#19
leohenon merged 37 commits intovimfrom
feat/copy-mode

Conversation

@leohenon
Copy link
Copy Markdown
Owner

@leohenon leohenon commented Mar 20, 2026

Part of #5

  • Add a copy mode that allows navigating the message timeline with the cursor using vim motions, and copy text via visual mode.

  • Skips over reasoning output and user messages

  • Full cursor position state engine

  • Cursor management with shift + M/H/L and viewport management with zz/zt/zb.

  • diff row copy handling

demo-copy-mode

@leohenon leohenon changed the title Feat/copy mode feat: copy mode Mar 20, 2026
@leohenon leohenon force-pushed the vim branch 2 times, most recently from 98d96fe to 230e66c Compare March 21, 2026 05:56
@leohenon leohenon force-pushed the vim branch 6 times, most recently from c427c33 to d24bd11 Compare March 22, 2026 09:01
@leohenon leohenon force-pushed the feat/copy-mode branch 2 times, most recently from 7bfa0f4 to e8669fa Compare March 22, 2026 11:01
@leohenon leohenon force-pushed the vim branch 2 times, most recently from b3980c0 to 760411e Compare March 23, 2026 12:15
@leohenon leohenon force-pushed the feat/copy-mode branch 2 times, most recently from 042ed9b to 0e93e41 Compare March 23, 2026 15:10
@leohenon leohenon merged commit c61e807 into vim Mar 24, 2026
1 check passed
@leohenon leohenon deleted the feat/copy-mode branch March 24, 2026 11:49
leohenon added a commit that referenced this pull request Mar 26, 2026
* feat: add vim copy mode with viewport cursor navigation and stabilize session scrolling

* fix(vim): copy-mode horizontal motions and cursor coordinate alignment

* fix(vim): copy-mode shift key handling

* fix: set tool row padding offset to match content position

* fix: skip user messages

* fix: prevent motions from leaking into input

* fix: replace lineInfo.lineStarts with plainText split for copy-mode line extraction

* fix: account for line-number gutter offset in copy-mode cursor clamping

* fix: dynamically compute line-number gutter width for copy-mode cursor

* fix: clamp copy selection index when scrolling in session view

* fix: snap copy selection to nearest visible row when scrolling out of view

* feat: add visual modes

* fix: use character-wise register for copy-mode yank to avoid blank line on paste

* fix: copy-mode indicator styling and V line-visual mode

* docs: document copy-mode

* test: add copy mode coverage for visual selection, yank, jumps, and motions

* docs: update readme for entry key config

* fix: keep copy-mode side borders muted in reasoning and tool output

* fix: make copy-mode w advance across lines like vim

* docs: update readme

* feat: skip reasoning output in copy mode

* fix: 0 key start of line instead of first non-whitespace

* feat: implement state management for sticky cursor for start/end of lines during vertical movement

* test: copy-mode cursor state management

* feat: add H/L/M cursor jumps

* feat: add zz/zt/zb viewport scroll

* fix: add missing copyWordPrev for b/B

* fix: exit copy-mode on session switch

* fix: hide prompt cursor in copy-mode to prevent flash on enter

* fix: make copy-mode scrolling preserve cursor row while visible

* feat: collapse diff views in copy mode

* feat: scroll to bottom when exiting copy mode

* fix: cursor offset for diff outputs

* fix: copy mode cursor alignment for wrapped lines

* docs: update readme

* feat: prepend diff sign (+/-) for copied lines

* test: wrapped vs non-wrapped lines for cursor state and motions

---------

Co-authored-by: leohenon <77656081+lhenon999@users.noreply.github.com>
leohenon added a commit that referenced this pull request Mar 26, 2026
* feat: add vim copy mode with viewport cursor navigation and stabilize session scrolling

* fix(vim): copy-mode horizontal motions and cursor coordinate alignment

* fix(vim): copy-mode shift key handling

* fix: set tool row padding offset to match content position

* fix: skip user messages

* fix: prevent motions from leaking into input

* fix: replace lineInfo.lineStarts with plainText split for copy-mode line extraction

* fix: account for line-number gutter offset in copy-mode cursor clamping

* fix: dynamically compute line-number gutter width for copy-mode cursor

* fix: clamp copy selection index when scrolling in session view

* fix: snap copy selection to nearest visible row when scrolling out of view

* feat: add visual modes

* fix: use character-wise register for copy-mode yank to avoid blank line on paste

* fix: copy-mode indicator styling and V line-visual mode

* docs: document copy-mode

* test: add copy mode coverage for visual selection, yank, jumps, and motions

* docs: update readme for entry key config

* fix: keep copy-mode side borders muted in reasoning and tool output

* fix: make copy-mode w advance across lines like vim

* docs: update readme

* feat: skip reasoning output in copy mode

* fix: 0 key start of line instead of first non-whitespace

* feat: implement state management for sticky cursor for start/end of lines during vertical movement

* test: copy-mode cursor state management

* feat: add H/L/M cursor jumps

* feat: add zz/zt/zb viewport scroll

* fix: add missing copyWordPrev for b/B

* fix: exit copy-mode on session switch

* fix: hide prompt cursor in copy-mode to prevent flash on enter

* fix: make copy-mode scrolling preserve cursor row while visible

* feat: collapse diff views in copy mode

* feat: scroll to bottom when exiting copy mode

* fix: cursor offset for diff outputs

* fix: copy mode cursor alignment for wrapped lines

* docs: update readme

* feat: prepend diff sign (+/-) for copied lines

* test: wrapped vs non-wrapped lines for cursor state and motions

---------

Co-authored-by: leohenon <77656081+lhenon999@users.noreply.github.com>
leohenon added a commit that referenced this pull request Mar 26, 2026
* feat: add vim copy mode with viewport cursor navigation and stabilize session scrolling

* fix(vim): copy-mode horizontal motions and cursor coordinate alignment

* fix(vim): copy-mode shift key handling

* fix: set tool row padding offset to match content position

* fix: skip user messages

* fix: prevent motions from leaking into input

* fix: replace lineInfo.lineStarts with plainText split for copy-mode line extraction

* fix: account for line-number gutter offset in copy-mode cursor clamping

* fix: dynamically compute line-number gutter width for copy-mode cursor

* fix: clamp copy selection index when scrolling in session view

* fix: snap copy selection to nearest visible row when scrolling out of view

* feat: add visual modes

* fix: use character-wise register for copy-mode yank to avoid blank line on paste

* fix: copy-mode indicator styling and V line-visual mode

* docs: document copy-mode

* test: add copy mode coverage for visual selection, yank, jumps, and motions

* docs: update readme for entry key config

* fix: keep copy-mode side borders muted in reasoning and tool output

* fix: make copy-mode w advance across lines like vim

* docs: update readme

* feat: skip reasoning output in copy mode

* fix: 0 key start of line instead of first non-whitespace

* feat: implement state management for sticky cursor for start/end of lines during vertical movement

* test: copy-mode cursor state management

* feat: add H/L/M cursor jumps

* feat: add zz/zt/zb viewport scroll

* fix: add missing copyWordPrev for b/B

* fix: exit copy-mode on session switch

* fix: hide prompt cursor in copy-mode to prevent flash on enter

* fix: make copy-mode scrolling preserve cursor row while visible

* feat: collapse diff views in copy mode

* feat: scroll to bottom when exiting copy mode

* fix: cursor offset for diff outputs

* fix: copy mode cursor alignment for wrapped lines

* docs: update readme

* feat: prepend diff sign (+/-) for copied lines

* test: wrapped vs non-wrapped lines for cursor state and motions

---------

Co-authored-by: leohenon <77656081+lhenon999@users.noreply.github.com>
leohenon added a commit that referenced this pull request Mar 31, 2026
* feat: add vim copy mode with viewport cursor navigation and stabilize session scrolling

* fix(vim): copy-mode horizontal motions and cursor coordinate alignment

* fix(vim): copy-mode shift key handling

* fix: set tool row padding offset to match content position

* fix: skip user messages

* fix: prevent motions from leaking into input

* fix: replace lineInfo.lineStarts with plainText split for copy-mode line extraction

* fix: account for line-number gutter offset in copy-mode cursor clamping

* fix: dynamically compute line-number gutter width for copy-mode cursor

* fix: clamp copy selection index when scrolling in session view

* fix: snap copy selection to nearest visible row when scrolling out of view

* feat: add visual modes

* fix: use character-wise register for copy-mode yank to avoid blank line on paste

* fix: copy-mode indicator styling and V line-visual mode

* docs: document copy-mode

* test: add copy mode coverage for visual selection, yank, jumps, and motions

* docs: update readme for entry key config

* fix: keep copy-mode side borders muted in reasoning and tool output

* fix: make copy-mode w advance across lines like vim

* docs: update readme

* feat: skip reasoning output in copy mode

* fix: 0 key start of line instead of first non-whitespace

* feat: implement state management for sticky cursor for start/end of lines during vertical movement

* test: copy-mode cursor state management

* feat: add H/L/M cursor jumps

* feat: add zz/zt/zb viewport scroll

* fix: add missing copyWordPrev for b/B

* fix: exit copy-mode on session switch

* fix: hide prompt cursor in copy-mode to prevent flash on enter

* fix: make copy-mode scrolling preserve cursor row while visible

* feat: collapse diff views in copy mode

* feat: scroll to bottom when exiting copy mode

* fix: cursor offset for diff outputs

* fix: copy mode cursor alignment for wrapped lines

* docs: update readme

* feat: prepend diff sign (+/-) for copied lines

* test: wrapped vs non-wrapped lines for cursor state and motions

---------

Co-authored-by: leohenon <77656081+lhenon999@users.noreply.github.com>
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.

1 participant