Sublime Forum

Make tab 8 spaces width, but keep space-based indents at 4

#1

I want the tab to be 8 spaces width, but at the same time I want to keep my space-based indents at 4 spaces. That is, here is how it should be:

if (a == b) {
>       this line is indented with a tab
}
if (a == b) {
....this line is indented with 4 spaces
}

Is it possible somehow?

0 Likes

#2

So you intent to use mixed indentation in the same file?

0 Likes

#3

Well, yes. I do understand, this is not a good practice, but still necessary in some contexts.

Actually, this is how some folks set up their Vim. The idea is that you can use 2 space indents, or you can use 4 space indents, or 8 space indents, but your tab characters must be set to 8, not more not less, simply because 8 spaces is the only real width of a tab.

0 Likes