Sublime Forum

How to use emmet wrap?

#1

I just installed Emmet plugin and found that not all functions are working… Generally i need to wrap my simple list with ul, for this i want to use docs.emmet.io/actions/wrap-with- … dual-lines but the problem is that i can’t call that input field which should appear on

I tried a lot of different hotkeys but still with no luck.

0 Likes

#2

Hi,
keep in mind that shortcut shown in the reference site are, as i found out by myself some times ago, not totally up-to-date, apart that, if i understood your need correctly, you need to wrap some lines into separates tags, like LIs.
So, if you have:

lorem ipsum dolor
Your needs are to get:

[code]

  • lorem
  • ipsum
  • dolor
[/code]

If that’s the case, what you have to do is to select all lines and then hit the “wrap_as_you_type” shortcut (CTRL+SHIFT+G on win/linux, CTRL+W on osX) then start typing the wrapper you need, if it’s UL with Lis you need to type “ul>li*” and hit return when you’re done.

hope it helps :wink:

0 Likes

#3

[quote=“Orlmente”]Hi,
keep in mind that shortcut shown in the reference site are, as i found out by myself some times ago, not totally up-to-date, apart that, if i understood your need correctly, you need to wrap some lines into separates tags, like LIs.
So, if you have:

lorem ipsum dolor
Your needs are to get:

[code]

  • lorem
  • ipsum
  • dolor
[/code]

If that’s the case, what you have to do is to select all lines and then hit the “wrap_as_you_type” shortcut (CTRL+SHIFT+G on win/linux, CTRL+W on osX) then start typing the wrapper you need, if it’s UL with Lis you need to type “ul>li*” and hit return when you’re done.

hope it helps :wink:[/quote]

oh man, thank! The main thing was that i can’t find the needed combination

0 Likes

#4

one more thing, for example if i want to do select like

<select> <option value="lorem">lorem</option> <option value="ipsum">ipsum</option> <option value="dolor">dolor</option> </select>

How to do it ? Tried something like this select>option[value=""] but didnt helped.

0 Likes

#5

Good question indeed,
the answer is a bit below in the documentation page, is “controlling output position” (i didn’t knew it aswell)…
you have to use the $# placeholder, so something like this select#test.foo[name="bar"]>option.foo-item-$[value="$#"]{$#}* will do the trick.
note that as stated in the reference you MUST specify also che value of the tag, note the repeated $# placeholder inside the curly brackets…

:wink:

0 Likes

#6

The abreviation wrap in sublime 2 (mac osx) is placed here: imagizer.imageshack.us/v2/1364x … hLIMdI.jpg

0 Likes

#7

imagizer.imageshack.us/v2/1364x … hLIMdI.jpg

0 Likes

#8

Sorry to reply to such an old thread, but I came here Googling why my shortcut keys were no longer working, and it seems that a recent version of Emmet has disabled the default shortcuts.

To enable keyboard shortcuts such as “Wrap with tag”, you now have to go to Preferences > Package Settings > Emmet > Key Bindings and then copy the relevant sections from the left pane to the right pane and uncomment them so they become active.

Hope that helps others out there looking for this. :slight_smile:

2 Likes

#9

Made an account just to say THANK YOU!!!

0 Likes