Open seeM opened 1 year ago
I suspect I am in a very tiny minority of people that use this though 😄
I would use it! And I suspect @lionel- too. I am a recovering emacs user and @lionel- is a current emacs user. I've been assuming that I could find some extension to get emacs keybindings working, but I had not tried to do it yet.
This convention dates all the way back to readline (https://github.com/chzyer/readline/blob/master/doc/shortcut.md). A lot of people who are accustomed to using R in the terminal are used to GNU readline shortcuts and over the years we've added a whole bunch of them to RStudio, including (yes) Ctrl K.
In RStudio these readline keybindings are always active in the console regardless of your editor's keybinding settings.
I think this is worth doing, but as in RStudio should probably be scoped to just the console (since that's the readline context).
Reading that doc on readline makes me realize that a lot of what I think of as Emacs keybindings are actually just readline keybindings.
I've become used to the following behaviour in many unix-based editors/terminals: Ctrl-k cuts from the cursor to the end of the line (placed into a buffer-local clipboard), and Ctrl-y then pastes from that clipboard.
This doesn't work in Positron or VSCode (See https://github.com/microsoft/vscode/issues/3684). I'd really like we could have Positron's source editor and console behave in this way too. I suspect I am in a very tiny minority of people that use this though 😄
I haven't tried it, but this extension claims to solve the problem: https://github.com/soutaro/emacs-c-k. It might be a good reference. It isn't available in Positron though.