Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 157 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

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.

share|improve this question

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

This question was marked as an exact duplicate of an existing question.