I\'ve noticed that most of the HTML/XML/HAML that gets generated from plugins uses 2 spaces instead of 1 tab. I use textmate and have tabs set to 4 spaces for HAML/HTML/XML and
2 spaces is generally agreed-upon.
2 spaces. Even for the plain Ruby kids.
As for all the arguments about different editors showing tabs with different widths...
It is a configuration setting people!
Change your editors to use two spaces for each tab. Different widths in different editors is not an argument. It is a moot point. If anything, using tabs allows people who prefer different widths to set and use the width they prefer. Hell, I think I like 3 spaces.
And you have to hit backspace twice just to un-indent something once. I'm a programmer, I'm lazy. I don't like to do things more than once!
In more practical terms, if you use mutliple OS and editors ( such as at work I used RubyMine on Win XP and TextMate on my MacBook at home and one of our developers uses Notepad ++ and another Aptana and we even have one who uses Netbeans, all of these editors interpret tabs differently - different indentation, but 2 spaces are always 2 spaces. Also if you ever use HAML or if you need to copy paste your code into some websites that try to colorcode your code, 2 spaces are essential.
For HTML & CSS look at this.
I recommend that you always check up the individual programing language before coding after they use different standards
E.g Python is using 1 tab(4 spaces) No matter what, while the recommend for HTML & CSS is 2 spaces
Two spaces are emerging as the standard because they are “just enough” indentation to make the HTML clearly indented to most people's eyes, but because HTML tends to nest very deeply — much more deeply than one would commonly nest when programming — and anything more than two spaces tends to start pushing HTML off the right edge of an 80-column screen pretty quickly.
Do not use tabs; use two spaces. Tabs are problematic because they can be a different width in different editors (and terminals, for that matter). Since whitespace is removed when you tidy your HTML before deployment, there is no ultimate bandwidth benefit to using tabs; they simply introduce a wildcard into your development experience.
I use Emacs, which auto-indents XML, HTML, and SGML with two spaces. I would be quite annoyed if I had to type indentation characters by myself; that's why I have an editor. :)