Wrapping a HTML element in Visual Studio Code using Emmet [duplicate]

风格不统一 提交于 2020-01-13 10:53:15

问题


I am using VSC for developing html pages. It's been a great experience using emmet with VSC, but often I find in a situation where I have to wrap a set of elements with a div, but have to use emmet on a single line and then cut paste the end tag at the end of the set of elements I want to map.

Is there any way where I can use emmet and automatically wrap the output of emmet around a set of selected elements?


回答1:


Try the Emmet: Wrap with Abbreviation command:




回答2:


The easiest way is to use a key binding, you can assign your own key for this. file > preference > keyboard shortcuts > editkeybindings and assign your own

[{ "key": "ctrl+shift+g", "command":"editor.emmet.action.wrapWithAbbreviation", "when": "editorTextFocus && !editorReadonly" }]


来源:https://stackoverflow.com/questions/44480051/wrapping-a-html-element-in-visual-studio-code-using-emmet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!