How to move one editing row up (back) or down (forward) in a multi-line command in bash/readline?
1 Answer
I'm assuming you're using Emacs keybindings in readline
(the default), in which case you can use the following:
- Ctrl + P - go to previous line
- Ctrl + N - go to next line
If you prefer vi
keybindings, those can be enabled by adding the following to your ~/.inputrc
: set editing-mode vi
-
4Yes, emacs mode. But it's not the answer. Ctrl+P/N goes to the previous/next command line. I am asking how to move cursor "screen width" characters back/forward so it's looks like moving one editing line up/down in a (long) multi-line command. Jul 13, 2015 at 8:43
-
1@HansGinzel Ah, I misunderstood slightly. Unfortunately I can't see anything obvious in the readline documentation. I believe the Emacs equivalent commands would be
next-logical-line
andprevious-logical-line
but I don't think readline has anything similar.– mjturnerJul 13, 2015 at 9:00