If you want that functionality you would have to use a plugin instead.
import sublime
import sublime_plugin
import textwrap
def _prepare_template(template):
# Normalize line endings in the template.
template.replace('\r\n', '\n').replace('\r', '\n')
# Remove common indent from all of the lines, but throw away the first
# line.
template = textwrap.dedent(template[1:])
# Throw away any trailing blank lines
return template.rstrip()
class LinkSnipCommand(sublime_plugin.TextCommand):
template = _prepare_template("""
<a href="${PASTED}">${SELECTED}</a>
""")
def run(self, edit):
selectedText = self.view.substr(self.view.sel()[0])
pasted = sublime.get_clipboard()
self.view.replace(edit, self.view.sel()[0], '')
self.view.run_command("insert_snippet", {
"contents": self.template,
"PASTED": pasted,
"SELECTED": selectedText
})
And create a key map
{ "keys": ["ctrl+f"], "command": "link_snip" },