Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 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 Duplicate:
How do I format my code blocks?

What is a quick way to format many lines of code for Stack Overflow?

I insert all 4xNLines spaces each time one by one, and wondering that there should be quicker way to do this, but can't find it in FAQ as well as on meta.

P.S Found one question about shift+enter, but it doesn't work for me. I'm using MacOS10.7, and Opera 12.

share|improve this question

marked as duplicate by Martijn Pieters, jonsca, Adam Lear Aug 20 '12 at 4:57

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.

up vote 3 down vote accepted

See the two {} in the editor toolbar, right above the big textarea where you type your question/answer? Highlight the code, and click that {} in the toolbar. This will format your code very quickly:

function test() {
    alert("hello world");

Pressing {} on the above code automatically put it inside a code block.

share|improve this answer
Or alternatively, select all and hit ctrl+k – Bart Aug 19 '12 at 20:49
jmort253, Thanks! (I will accept your answer in 10 minutes:) ) Bart, thanks too. – klm123 Aug 19 '12 at 20:51
that alternative comment have more votes than your answer o_o – ajax333221 Aug 19 '12 at 23:17
@ajax I simply leave brilliant comments.... :) – Bart Aug 21 '12 at 17:15
@Bart oh, I thought it was from jmort, my "your answer" is incorrect – ajax333221 Aug 21 '12 at 17:28

Not the answer you're looking for? Browse other questions tagged .