nordicmaterial2
6/23/2016 - 8:15 AM

Sublime Text Editor

Sublime Text Editor

You can do this with a custom key mapping. Go to Preferences -> Key Bindings-User and add the following:

[
{ "keys": ["super+b"], "command": "insert_snippet", "args": {"contents": "<strong>${0:$SELECTION}</strong>"}},
{ "keys": ["super+p"], "command": "insert_snippet", "args": {"contents": "<p>${0:$SELECTION}</p>"}}
]

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. 

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>"