You are not logged in.

#1 2014-04-23 19:28:11

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

readline vi mode 'operator pending' remapping

Is there any way to accomplish the equivalent of vim's 'operator pending' remapping with readline vi mode? For example if I have 'A' mapped to 'beginning-of-line' I want 'dA' to delete to the beginning of the line. It was hard enough trying to find how to do this in vim*, I'm coming up empty wrt readline.

* Nevermind the trauma of discovering the necessity: I type dn (n is remapped to f in normal mode) and instead of waiting for input, half my file disappears. yikes


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#2 2014-04-23 22:43:19

bulletmark
Member
From: Brisbane, Australia
Registered: 2013-10-22
Posts: 713

Re: readline vi mode 'operator pending' remapping

"d0" deletes to the beginning of line in both vim and readline.

Offline

#3 2014-04-23 23:20:54

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: readline vi mode 'operator pending' remapping

Thanks, but that was just an example. I currently have 10+ movement remaps for readline and expect that number to increase (only been using vi mode for a couple days). The only good solution is finding a way to remap them as operators as well.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#4 2014-04-24 01:27:21

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: readline vi mode 'operator pending' remapping

vi-mode is really just a pale imitation of Vi{m}. If you want to access those sorts of operators, you should enter 'v' in normal mode and drop into your $EDITOR...

You can read all of the readline variables here.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2014-04-24 01:35:15

bulletmark
Member
From: Brisbane, Australia
Registered: 2013-10-22
Posts: 713

Re: readline vi mode 'operator pending' remapping

jasonwryan wrote:

vi-mode is really just a pale imitation of Vi{m}. If you want to access those sorts of operators, you should enter 'v' in normal mode and drop into your $EDITOR...

If you do this then consider setting "shopt -s lithist" in your ~/.bashrc so that commands are expanded multi-line. Much easier to view and edit.

Offline

#6 2014-04-24 02:25:58

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: readline vi mode 'operator pending' remapping

jasonwryan wrote:

vi-mode is really just a pale imitation of Vi{m}. If you want to access those sorts of operators, you should enter 'v' in normal mode and drop into your $EDITOR...

You can read all of the readline variables here.

I'm not talking about unavailable operations. 'dw' has the same effect in readline as vim. I have 'O' remapped to 'vi-forward-word', which is functionally equivalent to what 'w' does in readline and vim. If I type 'dO' I simply want the 'O' to mean 'vi-forward-word' in that case too. It doesn't seem so far fetched that this should be possible.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

Board footer

Powered by FluxBB