This question already has an answer here:

I find the 4 space indentation to include code snippets unnecessarily difficult to use. Typically, when you copy and paste some code it requires manually reformatting each line (unless there's some hidden mechanism I'm missing). It's also weird that there's no way to specify what language you're actually showing in your code snippet (meaning the syntax highlighting is kind of a best-guess).

Github and CodePlex both use a system where triple backquotes (```) denote a block of code. IMO, this is much easier to use and requires zero reformatting after copying and pasting. They also allow you to specify the language immediately after the triple backquotes, to give the syntax highlighting a hint of what language you're showing.


``` JavaScript

function(foo) { alert(foo); }


Does anyone else feel this would be preferable to the current system?

P.S. I also think something similar would be better for block quotes, >>> perhaps?

Edit: Sorry if this already has been suggested, searching "triple backquote" yielded nothing.

marked as duplicate by Tim Stone, Arjan, user7116, Daniel Fischer, Cody Gray Apr 1 '13 at 20:33

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.


Another thing you can do is select the code (once pasted) and do CTRL + K.

This add 4 spaces of indentation at the beginning of every selected line. Note: It's works as a toggle so if you do it twice it will add then remove the 4 spaces.

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