control+u and control+d default keybindings for editing #60

Closed
opened 2026-02-16 17:25:00 -05:00 by yindo · 9 comments
Owner

Originally created by @net on GitHub (Jun 14, 2025).

Originally assigned to: @adamdotdevin on GitHub.

It looks like you have most of the important readline keybindings, which is fantastic!

Two that I immediately noticed are missing:

  • control+u should delete to the beginning of the line
  • control+d should delete the character after the cursor
Originally created by @net on GitHub (Jun 14, 2025). Originally assigned to: @adamdotdevin on GitHub. It looks like you have most of the important readline keybindings, which is fantastic! Two that I immediately noticed are missing: - control+u should delete to the beginning of the line - control+d should delete the character after the cursor
yindo closed this issue 2026-02-16 17:25:00 -05:00
Author
Owner

@adamdotdevin commented on GitHub (Jun 15, 2025):

i want to get mouse/trackpad scroll working; if we had that and pgup/pgdn, think that's a good default for scrolling?

@adamdotdevin commented on GitHub (Jun 15, 2025): i want to get mouse/trackpad scroll working; if we had that and pgup/pgdn, think that's a good default for scrolling?
Author
Owner

@net commented on GitHub (Jun 15, 2025):

I would consider having a separate mode for scrolling and selecting via the keyboard ala vim normal mode.

That way you can continue using ctrl+d/u to scroll, as well as take advantage of all the letter keys for moving a cursor around to do selection via keyboard. You could toggle between the modes with something like esc from the chat box to enter selection mode and something like i or c to re-enter the chat box. Then the chat box can use readline keybindings for editing.

You could also have dedicated keys for jumping by message. Something I find annoying with Claude Code is sifting through its output to find specific messages I sent.

If your goal is to build the vim of AI agents, then I think this type of modal interaction would be familiar to vim, helix, etc. users.

Mouse/trackpad scroll would be wonderful, although I think many would still want something they can control with a keyboard. pgup/pgdown are a good thing to support, but they're also keys that I don't think would be familiar to Mac users. I don't even know how to trigger them on my MacBook keyboard.

@net commented on GitHub (Jun 15, 2025): I would consider having a separate mode for scrolling and selecting via the keyboard ala vim normal mode. That way you can continue using ctrl+d/u to scroll, as well as take advantage of all the letter keys for moving a cursor around to do selection via keyboard. You could toggle between the modes with something like `esc` from the chat box to enter selection mode and something like `i` or `c` to re-enter the chat box. Then the chat box can use readline keybindings for editing. You could also have dedicated keys for jumping by message. Something I find annoying with Claude Code is sifting through its output to find specific messages _I_ sent. If your goal is to build the vim of AI agents, then I think this type of modal interaction would be familiar to vim, helix, etc. users. Mouse/trackpad scroll would be wonderful, although I think many would still want something they can control with a keyboard. pgup/pgdown are a good thing to support, but they're also keys that I don't think would be familiar to Mac users. I don't even know how to trigger them on my MacBook keyboard.
Author
Owner

@adamdotdevin commented on GitHub (Jun 15, 2025):

yeah, will give this some more thought. i was really hesitant to introduce modes as i wanted it to be simple to start typing a message at any time, but that's maybe just stubborn of me at this point

@adamdotdevin commented on GitHub (Jun 15, 2025): yeah, will give this some more thought. i was really hesitant to introduce modes as i wanted it to be simple to start typing a message at any time, but that's maybe just stubborn of me at this point
Author
Owner

@net commented on GitHub (Jun 16, 2025):

I think the primary default mode should still be insertion in the chat box, but I think it'll be hard to have selection capabilities on par with tmux without a second mode for moving a selection cursor.

So unlike vim where the default mode is NORMAL mode, I would have the user spend most of their time in the insert-into-chat-box mode, and have the scrollback mode be something they drop into if they want to use the keyboard to navigate and select text in the chat history (like tmux copy mode).

@net commented on GitHub (Jun 16, 2025): I think the primary default mode should still be insertion in the chat box, but I think it'll be hard to have selection capabilities on par with tmux without a second mode for moving a selection cursor. So unlike vim where the default mode is NORMAL mode, I would have the user spend most of their time in the insert-into-chat-box mode, and have the scrollback mode be something they drop into if they want to use the keyboard to navigate and select text in the chat history (like tmux copy mode).
Author
Owner

@GitMurf commented on GitHub (Jun 18, 2025):

i want to get mouse/trackpad scroll working; if we had that and pgup/pgdn, think that's a good default for scrolling?

While implementing vim modes would be awesome, I suspect that will take time. But for now, regardless of how <C-d> and <C-u> work, I agree getting mouse / trackpad scroll working would be great! I keep getting surprised when I go to review a longer LLM response by trying to scroll up with my mouse and it instead cycles through my message history ;)

Thanks for your wonderful work @adamdottv !

@GitMurf commented on GitHub (Jun 18, 2025): > i want to get mouse/trackpad scroll working; if we had that and pgup/pgdn, think that's a good default for scrolling? While implementing vim modes would be awesome, I suspect that will take time. But for now, regardless of how `<C-d>` and `<C-u>` work, I agree getting mouse / trackpad scroll working would be great! I keep getting surprised when I go to review a longer LLM response by trying to scroll up with my mouse and it instead cycles through my message history ;) Thanks for your wonderful work @adamdottv !
Author
Owner

@adamdotdevin commented on GitHub (Jun 18, 2025):

should land today along with configurable keybinds

@adamdotdevin commented on GitHub (Jun 18, 2025): should land today along with configurable keybinds
Author
Owner

@adamdotdevin commented on GitHub (Jun 18, 2025):

alright, configurable keybinds and mouse wheel scrolling are in latest, check the readme for more info!

@adamdotdevin commented on GitHub (Jun 18, 2025): alright, configurable keybinds and mouse wheel scrolling are in latest, check the readme for more info!
Author
Owner

@net commented on GitHub (Jun 18, 2025):

Works great, thank you!

@net commented on GitHub (Jun 18, 2025): Works great, thank you!
Author
Owner

@GitMurf commented on GitHub (Jun 18, 2025):

alright, configurable keybinds and mouse wheel scrolling are in latest, check the readme for more info!

love it! the scrolling is working as expected! Thanks

@GitMurf commented on GitHub (Jun 18, 2025): > alright, configurable keybinds and mouse wheel scrolling are in latest, check the readme for more info! love it! the scrolling is working as expected! Thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#60