Open rnmhdn opened 6 years ago
Unfortunately, this doesn't seem to be possible yet.
Notes (mostly to myself, but also to anyone who might want to investigate):
/key list cursor
).focus
hashtable, and hook_focus()
is only called on user input, once the cursor mode is active.A hacky way would be to do it via the xdotool
program (or similar), but that would only allow :<num>m
and :<num>q
, without support for ranges.
I can revisit this if weechat/weechat#1245 is resolved, but this is an admittedly niche issue and the WeeChat contributors might have other priorities. :)
I don't know much about weechat API but I was thinking maybe something like this would work: when user does :4,5m we do the following silently: :4 m save the value in text_input to a local array variable, say lines[0] :5 m save the value in text_input to lines[1] text_input='\n'.join(lines)
another way would be to just loop over the range and do :num and then paste and send. but the first solution would be much better because this one neither has the warning nor the yy functionality.
I can't send the "m" keystroke (or whatever key, short of using xdotool
) nor do its action directly in the script programmatically (this may be possible in the future, see the issue I linked above).
oh... my bad... sorry:D
This should be possible in a future WeeChat release / vimode update (I have a working implementation, but it requires a patch that isn't in WeeChat yet; the final implementation may also change), hopefully in a few months.
If someone wants to try it anyway, you have to build WeeChat from source and apply the above patch, then apply this patch to vimode.py.
I'm keeping the issue open for tracking purposes and as a reminder.
I think these commands can be so nice and handy.