This comes up anywhere you have to mix code and textual content: HTML, TeX, long comments in code, etc. Most editors will do this:

<div class="bla">
    <p>
        I want to write a long paragraph here. I want to write a long paragraph here. I want to write a long paragraph here. I want to write a long paragraph here. I want to write a long paragraph here. 
    </p>
</div>

or else

<div class="bla">
    <p>
        I want to write a long paragraph here. I want to write a long paragraph
here. I want to write a long paragraph here. I want to write a long paragraph
here. I want to write a long paragraph here. 
    </p>
</div>

The sight of it is just painful. To get the only readable possibility I can think of,

<div class="bla">
    <p>
        I want to write a long paragraph here. I want to write a long paragraph
        here. I want to write a long paragraph here. I want to write a long
        paragraph here. I want to write a long paragraph here. 
    </p>
</div>

you have to do the line breaks manually (obviously just fail). Is there a common feature of text editors and IDEs that would help with this that I'm not aware of? What's your strategy?

link|improve this question
feedback

1 Answer

Notepad++'s auto-indent would do what you were thinking of.

Amendment: Apparently I don't have privilege to comment in reply yet. Just an FYI in response to the comment, Notepad++ has HTMLTidy as well as XMLTools plug-in which does nice formatting for those. I'm sure many other editors would have the same features, I am just suggesting one of them.

link|improve this answer
The keyword here is autoindent. Many text editors have it, vim does (set ai), I'm sure the other one-true editor also does. – RedGrittyBrick Oct 21 '11 at 9:44
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.