Is there a shortcut (F4?) to instantly repeat last command (any command, edit command or plugin command...)?
It could be handy if you have to apply it to multiple lines manually, so you can move to the wanted line and F4, next line F4, skip to another line with cursor keys and F4 again...
Repeat Last Command?
-
- Posts: 2245
- Joined: 25.08.2021 18:15
Thanks but this will work only for "text commands" unfortunately, not with operations through plugins...main Alexey wrote:Command palette: 'repeat last text command'.
How to set hotkey? F9 in the command palette.
For example I've used the Plugin > Cuda-Ext > Align > Re-Wrap/split lines by margin... and set 90.
I'd like to repeat this (including 90 chars margin) every time I press F4 manually moving to selected lines only.
It would be very handy.
I see I can repeat last plugin command too with a shortcut, but this will just trigger the plugin function (in this case will ask every time to set the margin to 90).
It would be great a real generic "repeat last action" (the real action done to the text, not a call to a plugin function...).
-
- Posts: 2245
- Joined: 25.08.2021 18:15
>real generic "repeat last action" (the real action done to the text, not a call to a plugin function...).
That is not possible yet. what is possible: 2nd CudaExt command "Re-wrap/split lines by margin, with defaults". It uses CudaText option 'margin_right' , as you see from source of CudaExt
So set "margin_right":90 in user.json.
That is not possible yet. what is possible: 2nd CudaExt command "Re-wrap/split lines by margin, with defaults". It uses CudaText option 'margin_right' , as you see from source of CudaExt
Code: Select all
def rewrap_sel_by_margin_def():
...
margin = apx.get_opt('margin_right', 0)
if margin==0:
return app.msg_status(_('Set the margin via "Plugins / Cuda-Ext / Paragraph / Align: Configure..."'))
lex = ed.get_prop(app.PROP_LEXER_FILE, '')
cmt_sgn = app.lexer_proc(app.LEXER_GET_PROP, lex)['c_line'] if lex else ''
rewrap_sel_by_margin_ex(margin, cmt_sgn, True)
#def rewrap_sel_by_margin_def