Expand emmet autocompletes to multiple lines in sublime text

折月煮酒 提交于 2019-12-04 11:07:02

问题


When I type the following in sublime text 2 with emmet:

.one>label{foo}+input:r

I get one long line of code

<div class="one"><label for="">foo</label><input type="radio" name="" id=""></div>

is there any way to get emmet/sublime to output this style instead?

<div class="one">
    <label for="">foo</label>
    <input type="radio" name="" id="">
</div>

I tried playing around with the snippets.json with no success


回答1:


Create Packages/User/Emmet.sublime-settings with the content of

{
    // Output profiles for syntaxes
    // http://docs.emmet.io/customization/syntax-profiles/
    "syntaxProfiles": {
        "html": {
            "tag_nl": true
            // "tag_nl_leaf": true
        }
    }
}

And check the documentation for more information about tag_nl, tag_nl_leaf and other options.




回答2:


Its probably not the best answer but what I do is have reindent bound to a key and just hit that after.

In Preferences - Keybindings-User put something like

{ "keys": ["f12"], "command": "reindent"}

However im sure there is a way to do this properly



来源:https://stackoverflow.com/questions/21775954/expand-emmet-autocompletes-to-multiple-lines-in-sublime-text

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