7
1
I want to press M-j and have readline place my cursor on the next line without entering a command. Thus I should be able to go back a character onto the prev. line. This answer states that it cannot be done. I think it's wrong.
You can kill the newline character, and yank it. This achieves what I want to do. However I just can't create the binding.
To test this out type: echo <<EOF
RETURNENTERC-cC-pM-1C-dC-c
Now you should be on a newline, type C-y. It does what I want! But what character is this? What binding works in an inputrc file?
EDIT: It turns out the character is a line-feed. Still not sure how to bind it.
1You can type a newline as C-v C-j, which is mostly useful for breaking lines up while line editing. The linked question is referring to up and down cursor motions in a multi-line line edit. I'm not sure that either of those are what you want to do. – rici – 2015-03-30T04:11:36.903
I added some to clarify, I want to be on the next line and able to go back. – cdosborn – 2015-03-30T04:21:15.317
1On my system, @rici's shortcuts seem to achieve what you're asking for. What happens on yours? – Dennis – 2015-03-30T05:28:27.917
That is the correct behavior, The following binding works
"\ej": "\C-v\C-j"
based on how my terminal interprets meta. Please post an answer for me to accept @rici – cdosborn – 2015-03-30T06:24:48.400