The best solution is, if possible, to convince maintainers of the source code you're looking at to replace all the tabs by the correct number of spaces.
Using tabs is problematic in code today given that you're often seeing it on the web, where the decision of "how many spaces per tab" depends on where it's being displayed.
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
The best solution is, if possible, to convince maintainers of the source code you're looking at to replace all the tabs by the correct number of spaces.
Using tabs is problematic in code today given that you're often seeing it on the web, where the decision of "how many spaces per tab" depends on where it's being displayed.