Developer's Diary
Software development, with Terry Ebdon
28-Feb-2020 GitHub tab size

Tab size

GitHub defaults to showing code with an indents of 8 columns. This is very old-school, corresponding to the default 8 column tabs on ancient terminals. I don't know anyone that would expect to see code displayed this way. I've encountered the same tab behaviour on BitBucket, which is fixed by editing the URL. GitHub allows a similar URL trick, but there's a better way. Create an .editorconfig file in the repository root, like this:

root = true
[*]
indent_style = tab
indent_size = 2

26-Feb-2020 👈 Top of page 👉 05-MAR-2020

© 2020 Terry Ebdon.

Find me coding on GitHub, networking on LinkedIn, answering questions on Stack Exchange and hanging out on twitter.