With SublimeText3 my .editorconfig file contains:
[*.{h,cc,cpp}]
indent_style = space
indent_size = 2
tab_width = 8
I would expect tab characters in a file to expand to 8 spaces, but I'm seeing them expand to only 2 spaces. Hitting tab correctly indents by 2 spaces.
Is there a way to make it work as desired? So that tab characters expand to 8 spaces? But hitting tab still inserts 2 spaces?
That's because you're using indent_style = space
and providing indent_size = 2
.
If you want your tabs to spand 8 spaces, then use indent_size = 8
, but I'm pretty sure you don't want that!
In this case, since you want to work with tabs, then try this
[*.{h,cc,cpp}]
indent_style = tab
tab_width = 8
(Also its a good practice to check for mixed tabs and spaces in your files, that may lead to incorrect behavior in your config, which may not apply here, but it's a friendly reminder)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With