Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Can notepad++ correectly indent code? So if I had this:

<div><div><div></div></div>   </div>

Is there a way of turning it into this:

<div>
  <div>
    <div>
    </div>
  </div>
</div>
share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

You can use TextFX plugin to reindent code for you. If you don't have it, you will need to install in from your plugin manager. Once in place > just use the menu "TextFX" > "TextFX Edit" > "Reindent C++ code".

Probably it won't convert a single line, but actual code with miss-indentations will be handled well.

You will find more info and other plugins explained here.

share|improve this answer
    
The OP asked about HTML, not about C++ –  Imray Feb 9 at 20:44
    
And just to be doubly clear: the "Reindent C++ code" action does not indent my HTML code (N++ v6.5.1) –  Daryn Mar 27 at 21:33
    
@Imray Really? You don't say. –  Magnum Mar 28 at 7:53
    
@Daryn At the time of writing (1 year ago) this was working. –  Magnum Mar 28 at 7:55
    
@Magnum I hear you. That's why I added version number, I know these things change over time. –  Daryn Mar 28 at 17:48
add comment

Install Indent by Fold plugin. It works well with XML (or, derivatives) tags.

share|improve this answer
add comment

The Tidy2 plugin does exactly what you want.

share|improve this answer
3  
Can you add more information? –  Chipperyman May 29 at 14:13
3  
A link to developer's/distributor's website and some detail on plugin would be helpful –  smc May 29 at 14:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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