New keybindings: left copies and leaves cursor on the left?

Hi! I like the look of the new keybindings stuff. Is it possible to have it do one thing I’d quite like:

When I have cursored over a history command, pressing left copies the selected command to the command line, and leaves the cursor at the start (normal accept seems to always leave it at the end.) This is useful when I, for example, forget to put sudo first.

Something like:

[keymap.emacs]
"left" = [
  { when = "cursor-at-start", action = "return-selection && cursor-start" },
  { action = "cursor-left" },
]

is this possible?

Thanks, Robin.

That would be handy. Did you know that you can “sudo !!” and have it run the last command? I just found that out recently after 30 years :slight_smile:

Yeah :slight_smile: I intellectually know that, but my muscle memory from an almost similar timespan means I press up, left, and then type the missing prefix before I’ve remembered the !! trick