You can do this with a custom key mapping. Go to Preferences -> Key Bindings-User
and add the following:
{
"keys": ["ctrl+super+b"],
"command": "insert_snippet",
"args": {"contents": "<strong>${0:$SELECTION}</strong>"}
}
If the file is empty when you open it, put an opening square bracket [
on the first line, and a closing bracket ]
on the last line -- the file needs to be valid JSON. I used CtrlSuperB as the key binding, because CtrlB is already bound to the build
command. (Super is the Windows key or the Command key, depending on your OS and keyboard.)
To use the command, you can select what you want surrounded in <strong>
tags, and hit CtrlSuperB. The selection will remain selected - if you want to remove the selection and have the cursor after the closing tag, change the "contents"
to this:
"<strong>$SELECTION</strong>"
Finally, after triggering the key combo, you can keep the selection, then hit Tab to move to the end of the closing tag:
"<strong>${1:$SELECTION}</strong>$0"