I would like to have the possibility of inserting around a selection a prefix and a suffix text (both of them are paramterized) and call this action with a shortcut.
“Selected text” > [Prefixed text] Selected text [Suffixed text]
Vincent this can and is already done using buttons in the text editor. We call these “editor toolbar buttons”, as a rule they are tagged with $:/tags/EditorToolbar.
Within each editor toolbar button one or more actions can be specified and this includes your desired prefix/selection/suffix see WidgetMessage: tm-edit-text-operation.
Yes I have a number of times,
can you provide more details on why you want to do this?
eg “to wrap text in html tags”
I have already some solutions that may be a good fit.
Once you look into these buttons for “wrapping” the selection you find it gets more involved than you would expect.
I am gradually extending my current solutions to include ad hoc, named and asymmetric wrappers. Eg wrap in a tag open/parameters and close tag.