Sublime Forum

Control tab space in css files

#1

Ok I assume that I would set this in the per-type file, but there does not appear to be one for css. Do I create this?

0 Likes

#2

Ok it is not tab spaces but rather stopping the autoindent for css files. I created a CSS.sublilme.options file for css, and indicated autoindent false and the behavior still continues.

0 Likes

#3

Creating a CSS.sublime-options (under Packages/CSS) should work. If you’re editing CSS embedded in HTML, rather than in a stand alone .css file, then you’ll need to add the “autoIndent false” line to HTML.sublime-options

0 Likes

#4

this is in the CSS.sublime-options using version 1.3

Settings in here override the defaults in:

Packages/Default/Options/Default File Type.sublime-options

See there for the available options and their description.

The number of spaces a tab is considered equal to

tabSize 2

Set to false to disable automatic indentation

autoIndent false

and each time I create the brackets and push enter the newline is still autoIndenting on pure css files.

0 Likes

#5

Doing that works for me - can you confirm A) the location of the CSS.sublime-options file and B) The selected syntax on the status bar says ‘CSS’.

0 Likes

#6

The CSS sublime options resides in
C:\Documents and Settings\UserName\Application Data\Sublime Text\Packages\CSS\CSS.sublime-options

and I do see in the menu Preferences>Per-Type File Preferences>CSS

and the file in the status bar says CSS.

0 Likes

#7

I just tested it as well, specifying

autoIndent false

does not seem to work, it indents the next line after an accolade with two spaces, which is what my tabSize is set to.

0 Likes

#8

Whew I was beginning to think I just did not know what I was doing.

0 Likes

#9

Not sure if this is the desired behavior but after creating brackets you must push tab and then enter in order to have zero indention on the next line.

0 Likes

#10

Since trying out the new beta this behavior has changed back to auto indenting even though the css file preference has this disabled.

0 Likes

#11

I can see what’s going on now: this occurs because of this key binding in Default.sublime-keymap:

The binding doesn’t respect the autoIndent setting, which is a bug. I’ll change it for the next beta.

0 Likes

#12

Ok. I was beginning to think that I had done something wrong

0 Likes