How to change tab size on GitHub?

Misha Moroshko picture Misha Moroshko · Jan 12, 2012 · Viewed 68.8k times · Source

When I view files on GitHub, tabs appear as 8 spaces.

Example:

example

Is that possible to change this configuration to 2 or 4 spaces?

Answer

mortenpi picture mortenpi · May 7, 2014

You can append ?ts=2 or ?ts=4 to the URL to change the tab-size.

Example: https://github.com/jquery/jquery/blob/master/src/core.js?ts=2

It seems that the value can be anything from 1 to 12. It does not work on Gists or raw file views though.

Source: GitHub Cheat Sheet