[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Mon, 28 Jan 2013 15:22:48 -0800
On Mon, Jan 28, 2013 at 3:07 PM, Egmont Koblinger <address@hidden> wrote:
> Hi folks,
> Sometimes I work with quite long command lines (4-5 lines on the screen)
> and I need to modify something somewhere in the middle. I know a couple of
> ways to move the cursor there a little bit faster than holding the left
> arrow (e.g. backward-word, or Alt+number then left arrow), I also know
> about some non-interactive ways of editing a command line, but still I find
> all these quite frustrating and time consuming.
> The feature I've always missed from bash's line editing is to be able to
> move the cursor up vertically by a line, using some shortcut key. I
> believe this makes the interactive editing of long command lines faster and
> way more convenient.
If I need to deal with a quite long command line I usually press C-x C-e
(or v when in vi mode) to invoke my favorite vim editor to edit the command
and then run it. With vim, you can press gj and gk for your purpose here.
(Actually I always nnoremap j to gj and k to gk in my vimrc. :)
> I've quickly prototyped such a feature. Please apply the attached patch,
> put this in your .inputrc:
> "\e[1;5A": backward-line
> "\e[1;5B": forward-line
> and try Ctrl+Up and Ctrl+Down on multi-line command lines to move the
> cursor vertically.
> Do you guys like this feature, do you think it could make it into official
> If so, let me come up with a proper patch (it's going to be much more
> complicated in order to support double wide characters. The current one is
> just a quick demo of the proposed feature which only works correctly with
> single-cell characters.)