Please add configurable default tab-size already

I’m copying the last support ticket I submitted requesting this feature, which is something I’ve done on an almost yearly basis until I learned of this forum.

Dear GitHub,

I’ve requested this almost every year since 2015, and will continue to do so: Please add a repository-level setting to change the default tab-width of 8 columns. You added .editorconfig support, but that isn’t an adequate solution — you’re forcing users to abuse an EditorConfig setting that affects how collaborators can contribute to their repository.

The whole point of semantic tab-use is to enable others to read your code with the indentation-size they’re most comfortable with. This might be simple preference, or a product of physical constraints such as screen- or font-size. By requiring indent_size = 4 to override an unwieldy historical default, you’re taking this benefit away from users whose codebases are formatted with accessibility in mind.

PLEASE add a repository-level setting for this. It’s a simple case of adding the following CSS to a page’s header:

<style>
	/* Replace `8` with configured repository setting */
	:root{
		--tab-size: 8;
	}

	/* Add any other selectors styled with `white-space: pre;` */
	.blob-code-inner, pre, code, tt {
		-moz-tab-size: var(--tab-size);
		tab-size:      var(--tab-size);
	}
</style>

The solution above uses a CSS variable that can be overridden in specific elements by adding style="--tab-size: 4", if such a thing is needed.

If there’s a reason GitHub staff refuse to add this feature, please e-mail me the official explanation.

Punting this as “low priority” is absurd when it takes very little effort to add, and many users have requested it time and time again… for years (see isaacs/github#170).

Moreover, you listened to my incessant nagging about adding 1-pixel dividers between language-colours in repository stat-bars, which is no less complicated (and far more trivial) than adding a tab-size feature.

Yours,
@Alhadis

(Some links were culled from the original ticket to satisfy the 2-link limit imposed for newly-registered users)

Hi there! :wave: Welcome to the Community!

Thanks for this feedback! We’re always working to improve GitHub and the GitHub Support Community, and we consider every suggestion we receive.

Ordinarily, I would suggest submitting this through our official product feedback form so that our product team can track your request, but I just checked, and the ticket you wrote into support about this has actually been passed on to our product team already. We can’t guarantee a response to every submission, but they do evaluate all requests that come in.

In the meantime, please let us know if there is anything else we can do for you and we will be happy to assist!

If this request gets turned down, I’d like to know the reasoning behind it. It’s a frequently-requested addition that takes minimal effort to implement.