What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 127 Stack Exchange communities.

Is there any code formatter for HTML, CSS, JavaScript to format code quickly in SO editor friendly format?

I want to format code in good manner and without having horizontal scroll bar for source in question.

share|improve this question
add comment

1 Answer

Why not format your code properly before you insert it into your question? You can format code much faster in your native editor than in anything else.

I use vim for everything, so I write my code in a vim window and then paste it. Often I start answering a question in the browser and then need to write some code, so I use the Firefox plugin "It's All Text!" to invoke a vim instance, edit my code and format it properly, and it is automatically inserted into the browser text box.

If you limit the width in your native editor to 80 characters (and use a tab-width of 4, if you're using tabs, which will show as at most 4 spaces in Markdown), it will probably render without any horizontal scrollbar in most browsers:

         1         2         3         4         5         6         7         8
12345678901234567890123456789012345678901234567890123456789012345678901234567890
t   t   t   t   t   t   t   t   t   t   t   t   t   t   t   t   t   t   t   t   
share|improve this answer
    
even my code formatted in dreamweaver shows horizontal scroll bar. is there any width or character limit in SO editor? –  Jitendra Apr 24 '10 at 16:31
    
@Jitendra , you'll need to limit the line width in your Dreamweaver editor. –  Arjan Apr 24 '10 at 16:59
add comment

You must log in to answer this question.

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