Auto format document with Notepad++

TextFX has the options to insert line breaks and tabbing:

TextFX


Download the "NppAutoIndent" plugin.  In Notepad++:

Plugins → Plugin manager → Available → NppAutoIndent

The "NppAutoIndent" plugin has 'smart' indentation for C-style languages, such as C/C++, PHP, and Java.  It's the first release, so don't expect it to be flawless, and of course it might not be completely to your preferences.  There is NO support for HTML/XML and such, maybe later, tag matching is much more difficult to implement.  To use it, select your code and:

TextFX → TextFX Edit → Reindent C++ code

If you cannot see TextFX in your menu, you can install its plugin from SourceForge.

References:

  • SourceForge
  • Notepad++ Home (notepad-plus-plus.org)
  • Brief mention in Auto-indent in Notepad++ (on Stack Overflow)
  • Reindenting C Source Code Files With Notepad++ (blog)

For JavaScript, the JSTool plugin will do this job.

enter image description here

Tags:

Notepad++