Here’s a possible alternative, which causes the snippet to end after the first tab marker, but before the selected text (if any).
-
Create a new snippet (Tools -> New snippet…)
-
Paste in this code, which is a slightly modified version of the relevant snippet in the XML package:
<snippet>
<content><![CDATA[<${1:p}>$0$SELECTION</${1/([^ ]+).*/$1/}>]]></content>
<tabTrigger><</tabTrigger>
<scope>text.xml</scope>
<description>Long Tag</description>
</snippet>
-
Save this snippet in the “User” package folder as long-tag.sublime-snippet (you can call it anything, but I use the same file name as the snippet in the XML package, just to help me remember what I’m overriding).
-
In the User Key Bindings, add:
{ "keys": "ctrl+shift+w"], "command": "insert_snippet", "args": { "name": "Packages/User/long-tag.sublime-snippet" } }
After saving the new key binding, the snippet you created will be used instead of the one in the XML package (specified in the default key bindings). Refer to the long-tag snippet in the XML package and to the sublime text 2 snippet documentation if you want to see the difference. Refer to the default key bindings to see the overall format for the user key bindings file, if needed.