Use emmet to edit a5 or span5 in vscode, the perfect solution without automatic line wrapping

Hits: 0

Friends, long time no see, I wonder if you have this trouble? After tossing for a while today, I finally solved it, perfect solution, share it with you

Analysis : For Baidu, we can find solutions to similar problems in WebStorm, but VSCode does not or I did not find that WebStorm’s solution is to directly modify the IDE configuration. There is no such configuration in VSCode. On the built-in emmet, after searching (keywords “inline”, “inline”, “new line”)

Idea : Modify the emmet configuration file, set the inline_breakattribute value to 2, so that when two inline elements are reached, the line is forced, and so on; if the value is 0, the inline element will not be wrapped,

Solution : vsodeSearch Syntax Profilesin the settings settings.json, edit it, and add the following code:

"emmet.syntaxProfiles": {
   "html": {
       "inline_break": 2
    }
}

Note: Since the json configuration file is used, pay attention to the location of the configuration. If there are other configurations under this configuration, you need to add the end of the ,separator table at the end. If it is configured at the end, it is not required.

"emmet.syntaxProfiles": {
    "html":{
        "inline_break":2
    }
},

It will take effect immediately after saving, input a 2 or span3, etc. can automatically wrap.

Leave a Reply

Your email address will not be published.