How to do tag wrapping in VS code?

后端 未结 7 1387
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-04 05:10

I would like to wrap my selected html within a tag in VS code. How do I do that?

7条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-04 05:53

    As I can't comment, I'll expand on Alex's fantastic answer.

    If you want the Sublime-like experience with wrapping open up the Keymap Extensions (Preferences > Keymap Extensions [Cmd+K Cmd+M]) and add the following object:

    {
        "key": "alt+w",
        "command": "editor.emmet.action.wrapIndividualLinesWithAbbreviation",
        "when": "editorHasSelection && editorTextFocus"
    }
    

    Which will bind the Emmet wrap command to Alt+W when text is selected

    (Sorry for OSX only instructions)

提交回复
热议问题