Sublime Forum

Tabs not working in a new project

#1

I created a new project, and I used Preferences->Settings to set the following:

{
“color_scheme”: “Packages/Color Scheme - Default/Dawn.tmTheme”,
“font_size”: 8,
“ignored_packages”:
[
“Vintage”
],
“tab_size”: 3,
“translate_tabs_to_spaces”: true,
“use_tab_stops”: false
}

This doesn’t work with a new file that I copied into the project and then opened. I see tabs of 2 and 4 applied, but never 3 as specified above.

0 Likes

#2

Now it’s started working.

I think the problem may have been that the file I imported into the project had soft tabs at a variety of positions in the file, and after I manually converted the whole file to use soft tabs of 3, Sublime was able to intuit that this is what I wanted and then started honoring new lines I added with my preferred tab stop setting.

Probably a new file in the project will honor the tab setting, since there are no existing lines that use a different setting.,

0 Likes

#3

You may want to tweak this setting as well:

    // Set to false to disable detection of tabs vs. spaces on load
    "detect_indentation": true,

Although the comment doesn’t mention it, part of detecting the indentation is detecting the tab size. All else being equal the most common reason that I’ve personally seen for the settings you mentioned not being honored is indeed that with this setting defaulting to true there’s something in the file that makes Sublime think you want it indented differently.

The second most common is installing a third party package like EditorConfig or something similar, which overrides your settings in favour of an external configuration.

0 Likes