Sublime Forum

4 spaces for tabs

#1

I am trying to set the tab key to insert 4 spaces.

I am putting this line in the users settings

“translate_tabs_to_spaces”: true

But tab is still insert a tab. When I press tab and then the back arrow, the caret jumps back a whole tab with one left arrow push. If 4 spaces were inserted, I would assume the left arrow would jump the caret back one space at a time.

Just to ensure there is no typo, this is my user prefs

[code]{
“caret_style”: “phase”,
“color_scheme”: “Packages/User/SublimeLinter/deep_blue_see_Spacegray (SL).tmTheme”,
“font_face”: “Consolas bold”,
“font_size”: 8,
“highlight_line”: true,
“ignored_packages”:

	"Vintage"
],
"theme": "Spacegray.sublime-theme",
"wide_caret": true,
"word_separators": " ./\\()\"'-:,.;<>~!@#$%^&*|+=]{}`~?	",
"translate_tabs_to_spaces": true

}[/code]

0 Likes

#2

If a file has tabs in it, Sublime Text will see them and assume that you use tabs in your file. Use the menu in the bottom right to convert tabs to spaces or change things for an individual file. You can also turn off this autodetection.

0 Likes

#3

how?

0 Likes

#4

You can search your preferences for “indent” or “detect”, and find this:

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

0 Likes