Create a keyboard shortcut to insert text before and after a selection

How do I create a keyboard shortcut to insert text before and after a selection?
I want to make a selection, press a key and this action results in the addition of (without quotes) “{{c1 ::” at the beginning of the selection and “}}” at the end of the selection

Creating a keyboard shortcut for this is not the challenge here. The real problem is to write a macro for this. And what is meant by “selection”. Is it a “selection of a (whole) cell” or does the phrase include “selection of a part of a cell” as well)

By selection I mean a part of a cell, a word or a phrase of a cell.