From http://stackoverflow.com/questions/15142619/automatic-hard-vs-soft-tab-indentation-based-on-type-of-file