Possible Duplicates:
Automatic code reindent button
AutoIndent of Source Code

I realize that you can already indent code blocks with the 'code sample' button or ctrl+K, but that's something you have to do after you've finished writing them. This request is about indenting as you go.

My request is to automatically add the indentation of the previous line after hitting enter. So when typing in the code, the 4 spaces are added automatically for a new line until the code block is ended (by removing them).

It would also be nice if additional indenting is also preserved, for example when the code contains a scope which is indented with extra spaces.

marked as duplicate by Cody Gray, balpha Aug 7 '11 at 14:36

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.