I can not wrap my head finding a solution for this simple editing task in Readline.
I just want to kill the characters forward until the end of a Big word, that is, (more or less) until the next space character (dE
in vim).
Specially, when hitting a key sequence,
> 2234I567.890 32345678
would become
> 2234I 32345678
where the cursor position is indicated by I
.
Here are what I've tried to add in ~/.inputrc
to make it happen.
First attempt:
"\eF": vi-fWord "\eD": "\eF\C-w"
This does kill forward for a Big word, but it works incorrectly if the cursor is placed in word. In that case, the whole word is killed.
Second attempt:
"\eF": vi-fWord "\C-x1": kill-region "\eD": "\C-@\eF\C-x1 "
This should have worked, shouldn't it? At least it works if I manually kick the
complete \C-@\eF\C-x1
key sequence myself on the commandline.
However it was weird that nothing happened when I kicked \eD
key sequence.
- I also thought about using vi mode command
vi-delete-to
and the likes, but not sure how to do it due to the complete lack of documentation relating to Readline vi mode.
So I'm here to seek help.