Hacker News new | past | comments | ask | show | jobs | submit login

append ?ts=4 to the URL to change GitHubs default 8 character tab to 4 characters wide.



Is that really a GitHub thing? When I view diffs in the command line with Git, it always shows tabs as 8 spaces too.


8 spaces tends to be the de facto standard tab width. But because tab is it's own ASCII character (0x09), much like how space (0x20) and the lower case letter 'a' (0x61) are, it means it's up to whatever text processors used (eg diff, vim, GitHub web application, etc) to interpret a tab character by whatever width they choose. Which is why tab spaces are a per-application setting, eg:

    diff --tabsize=4 ...
    vim "+set tabstop=4" ...
    http://github.com/.../file?ts=4




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: