Inigo
Inigo

Reputation: 8685

Wrap selection in html tag suddenly stopped working in Sublime Text 3

Help! One of my favourite and most-used keyboard shortcuts has suddenly stopped working in ST3:

Shift + Alt + W (Wrap selection in HTML tag)

I've recently updated to the latest version which is currently 3114. I've checked the keymap settings, and nothing that I can see there is overriding it. I've also tried disabling all installed packages, as per this answer. Still nothing happening. That shortcut has just completely dropped dead. Any ideas? I need it back!

Thanks

Upvotes: 0

Views: 289

Answers (1)

Keith Hall
Keith Hall

Reputation: 16075

  1. From Sublime Text, go to the Tools menu -> Browse Packages.
  2. Create a folder called XML.
  3. Create a folder called Snippets.
  4. Create a file called long-tag.sublime-snippet.
  5. Open it.
  6. Paste in the following (from https://github.com/sublimehq/Packages/blob/master/XML/Snippets/long-tag.sublime-snippet):

    <snippet>
      <content><![CDATA[<${1:p}>${2:$SELECTION}</${1/([^ ]+).*/$1/}>]]></content>
      <tabTrigger>&lt;</tabTrigger>
      <scope>text.xml</scope>
      <description>Long Tag</description>
    </snippet>
    
  7. Save it

  8. Copy it up one level, to the XML folder.

The keybinding will now work.

Upvotes: 2

Related Questions