Welcome to the Forum, Pierre :icon14:
I guess I know what you want. Many years ago I used to have a resident proggie that accepted exactly two keys after hitting F2, and expanded e.g. <F12> ic to <a bunch of lines that correspond to your idea of
insert
code>
On Windows, implementing that is not trivial, because every process has its own environment, keyboard buffer included. There are workarounds, but they are probably illegal, in some sense ;)
It becomes a lot simpler if you can do it from within your own process. If you've written the editor that uses this feature, just insert the necessary and off it goes. For example,
RichMasm (MasmBasic's editor) uses the space key to expand e.g.
.rep to...
.Repeat
x
.Until 0
... and even selects the x so that you can just continue typing the details of your loop. Masm32's QEditor has a similar feature afaik.
The problem is that doing the same for an editor that you have
not written yourself would require an intrusion into its process space. That is commonly called hacking, and not polically correct in this Forum, for good reasons...