tags:

views:

22279

answers:

6
+4  A: 

In the latest version (at least), you can find it through:

  • Settings (menu)
  • Preferences...
  • MISC (tab)
  • lower-left checkbox list
  • "Auto-indent" is the 2nd option in this group

[EDIT] Though, I don't think it's had the best implementation of Auto-indent. So, check to make sure you have version 5.1 -- auto-indent got an overhaul recently, so it auto-corrects your indenting.


Do also note that you're missing the block for the 2nd if:

void main(){
  if(){
    if() { }  # here
  }
}
Jonathan Lonowski
Note that this auto-indent setting in Notepad++ assumes you do the first indent in a block manually; it doesn't auto-format the code for you.
scronide
I got your meaning just now,please forgive my poor Eng...My mother language is Chinese...
Turion
+8  A: 

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.

scronide
A: 

I cannot post pictures correct ,so .....

Turion
This is not an answer to your question. You are not in a forum, such remark belongs to comments (or to an edit of your question).
PhiLho
Bad news to me. I'm a new man....
Turion
+2  A: 

Most developers of text editing programs misuse this name (auto-indent). the correct name is "maintain indentation", auto-indent is what you actually want but not implemented i would also like to see this feature in notepad++

+1  A: 

Download and use the plugin NppAutoIndent in Notepad++.

http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Plugin_Central

Daniel
Thanks, this actually works!
DMan
A: 

There seems to be an option for auto-format of XML atleast. It can be found at TextFX->TextFX HTML Tidy->Tidy: reindent XML

Abhishek