Date published: 04.06.2021
Table of Contents

How to change Github tab indentation length

Last update: 02 December 2021


For tab characters Github, by default, uses an indentation length that equals the width of 8 space characters. This is not always desired, but luckily, you can change the way Github displays this indentation, both for your own code or for others code.


Your own code

If you want to change how your code is displayed by Github you need to tell your text editor to insert space characters instead of tab characters whenever you press the tab key.

Changing the display length of tab characters will not work, since Github will still see it as a tab character, and apply its own logic for how these should be displayed, different from your text editor. By inserting a space you force Github to apply the rules for how it displays space instead, which is the same as your editor (if you didn't mess with settings).


In Atom text editor

To permanently change how Github displays your code indentation if you use the Atom text editor, follow these steps:

  1. Go to "Settings" (ctrl + comma)
  2. Select "Editor" from menu
  3. Scroll to bottom
  4. Under the "Tab Type" heading select "soft" in dropdown

PS: You can also tweak how many spaces is inserted when you press tab by changing the value in the textfield under "Tab length" (the setting directly above "Tab Type").


Others code

If you do not have access to the file directly because the code is not yours, e.g. when you view public code/repositories, you can still change the indentation by passing data to the browser URL.

Add ?ts=length to the url, length being any number between 1 and 12, like so: https://github.com/somelibrary/src/main.js?ts=2

This is not permanent, however, and needs to be done each time you visit a new page/file.

(keyword + keyword*isBold) * isBold / number of unik keywords occurrences/links page authroti itself for the linking site gives a score for a keyword? query? then ranks/updates the indexes list on order/weight so can just retrieved the first 5 for keyword?