Using an editorconfig file I never had an issue doing this. I get a tab if I hit tab and a space if I hit space.