Sublime Forum

Keyboard Shortcut for Wrap Selection With Tag

#1

A search via Google shows Alt+Shift+W as the keyboard shortcut for Wrap Selection With Tag, which is found in the Edit menu, Tag submenu. The menu shows no such shortcut, and Alt+Shift+W does nothing, as far as I can tell. I tried this for

 tagging in my sublime-keymap file:
{ "keys": "alt+shift+q"], "command": "insert_snippet", "args": {"contents": "<pre>${0:$SELECTION}</pre>" } }

which is fine for a specific tag, but not the same as Wrap Selection With Tag, which inserts P tags and selects both the opening and closing tag. I also tried:

{ "keys": "ctrl+shift+a"], "command": "wrap_selection", "args": {"with": "tag"} }

but that doesn’t seem to work, and I can’t find any command in the documentation for wrapping. I appreciate any assistance you can provide. Thank you.

Michael Blaustein

0 Likes

#2

Bumping this in hope of support. Thank you.

0 Likes

#3

Wrap selection with tag works fine for me (Build 3035). Have you tried logging commands to make sure it is running (sublime.log_commands(True) in the console). Well, in any case, try replacing your snippet argument with the following.

<${1:p}>${2:$SELECTION}</${1/(^ ]+).*/$1/}>

Above is what the “Wrap Selection with Tag” command uses (well actually it’s just an insert_snippet command).

0 Likes