Search code examples
tabsgithubtab-size

How to change tab size on GitHub?


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?


Solution

  • Update

    Yes. As stated by mortenpi, this can be done by through an additional query parameter. See his answer for more details.

    Original answer

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

    No. It's only available as part of the editing feature through the Ace editor and the change is not persisted.

    This blog post gives some more information about the embedded IDE.

    However, provided you know the url of the blob (file) you're willing to review, you can switch to the edit mode easily by changing the blob segment with an edit segment and use the dropdown to select your prefered tab size.

    tabSize