UI for quick pattern application

Idea:

  1. Select some code.
  2. Click/Press something to mark it as example.
  3. Select some other code and click/Press something to apply the pattern seen in the example to the code.

In general the point is to replace typing requests with UI. To be quicker than explaining to the AI “Use this as an example to apply to that”. It is a very common AI request for me that can be automated and also improved via better internal (hidden; maybe long) prompting.

Additional use cases:
Maybe in the clipboard I have code from the internet and I want to apply a pattern in my code to the one in the clipboard before/after pasting it.

Additional features:
Add some common settings like:

  • (checkbox) follow only the style when applying the pattern, not the logic (it’s different in the new code) or vice versa. (then some magic prompting happens to squeeze the most out of the request)
  • (checkbox) follow only the naming style of variables

Similar idea (saves typing AI prompts):

On Ctrl+K to have a small list of recent and favorite prompts to choose from.

E.g. I often use this prompt [split every 5-6 words with ‘" <> "’] and I may save it as a favorite prompt to pick it from a list later again and again.