skip to Main Content

I have a very simple question but i cant find an answer to it.
if i have a paragraph <p> hello world</p>
and now i want to put the "world" inside a <em></em>.
what im looking for is a shortcut to mark the word and write the <em>
and i wont have to delete and replace the word i want.

2

Answers


  1. What you could do is to use Emmet shortcuts to write speed up your code writing.

    Things like:
    p>{hello world} will expand to <p>Hello world</p>

    And then:
    em>{world} will become <em>world</em>

    If you want to do all together:
    p>{hello}+em>{world} which will be then expanded to <p>hello<em>world</em></p>

    You can read more here:

    1. https://docs.emmet.io/
    2. https://code.visualstudio.com/docs/editor/emmet
    Login or Signup to reply.
    • select the text world
    • use the command Emmet: Wrap with Abbreviation
    • type em and Enter

    If you need to do it often with the same abbreviations you can use an extension I wrote: Recently Used. In the extension settings you can predefine abbreviations.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search