Skip to content

Make "copy line down" hotkey in the shortcuts page of the marimo editor editable #7056

Description

@mullimanko

Description

I would like to ask to make the "copy line(s) down" hotkey in the shortcuts page of the marimo editor editable, if feasible (possible also the "copy line(s) up" hotkey). Currently, the hotkey is not editable because #6843 didn't override it in the codemirror settings.
The reason is that I would find it nice if I could switch to Ctrl + D.

Suggested solution

Change codemirror settings

Are you willing to submit a PR?

  • Yes

Alternatives

No response

Additional context

No response

Activity

  1. kallal79 commented on Apr 3, 2026

    @kallal79

    I’ve already started working on this issue and would like to be officially assigned.
    Please assign me so I can continue with the implementation and submit a PR. Thanks!

  2. Abdulrehman-PIAIC80387 commented on Jul 20, 2026

    @Abdulrehman-PIAIC80387
    Contributor

    Hi — checking in on this one, as it looks unclaimed (#6843 landed the panel entries, but left both hotkeys editable: false).

    I have a fix working locally that follows the override pattern already used for toggleComment/toggleBlockComment in frontend/src/core/codemirror/keymaps/keymaps.ts:

    1. add copyLineUp/copyLineDown to OVERRIDDEN_COMMANDS, so CodeMirror's hardcoded Shift-Alt-Arrow bindings are filtered out of the default keymap
    2. re-bind them in overrideKeymap() using keymap.getHotkey(...), so they follow the user's configured key
    3. drop editable: false from both entries in hotkeys.ts

    Default keybindings are unchanged; only the ability to reconfigure them is added. make fe-check passes and the existing generic assertions in keymaps.test.ts (which compare overrideKeymap().length against OVERRIDDEN_COMMANDS.size) pick up the new commands automatically. I've added a test asserting an override to Ctrl-D actually reaches the keymap — the rebinding @mullimanko originally asked for.

    I'll open this as a draft PR shortly so the diff is easy to look at. Since this issue doesn't carry the ready label, please treat the PR as awaiting your go-ahead rather than a review request — happy to close it if you'd rather this waited or went a different way.

    Disclosure: this change was authored by a coding agent, reviewed by me before posting.

  3. added a commit that references this issue on Jul 20, 2026
    f8e6a53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions