Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Expand emmet autocompletes to multiple lines in sublime text

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

like image 664
Tony UK Avatar asked Feb 14 '14 09:02

Tony UK


People also ask

How do I type multiple lines in Sublime text?

Multi-line editing. Most commonly I use cmd+d to select the next instance of selected text. In the animation below I select the first instance (with alt+shift+left ), then press cmd+d to select the next instance. If you want to skip an instance you can press cmd+k, cmd+d .

What is Emmet Sublime text?

In sublime text editor you can install Emmet Package to do fast coding. It is one of the best package for faster HTML and CSS coding workflow. You can easily create faster coding using simple abbreviations/shortcuts. This packages makes Programmer Life Easy.

What is Emmet Package?

Emmet is a web-developer's toolkit for boosting HTML & CSS code writing. With Emmet, you can type expressions (abbreviations) similar to CSS selectors and convert them into code fragment with a single keystroke.


1 Answers

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.

like image 88
Taylan Avatar answered Oct 11 '22 12:10

Taylan