Auto-indent in Notepad++

Turion picture Turion · Jan 5, 2009 · Viewed 727.1k times · Source

We always write code like this formal:

void main(){
  if(){
    if()
    }

Alt text

But when I use Notepad++, the display is:

void main(){
if(){
if()
}

Alt text

How do I use Notepad++ to auto indent?

Thanks to Jonathan, I have set it, but it does not take any effect. The snapshot is below:

Alt text

I am using Notepad++ version 5.1.3.

Answer

scronide picture scronide · Jan 5, 2009

Notepad++ will only auto-insert subsequent indents if you manually indent the first line in a block; otherwise you can re-indent your code after the fact using TextFX > TextFX Edit > Reindent C++ code.