Topic: Work Tools Revamp - JavaScript and CSS indents in emacs

Topic type:

I can't believe this took so long to find! How to get CSS and JavaScript modes to honor tab-width.

Finally figured out how to get CSS, SCSS, SASS, and JavaScript modes to be the proper tab width!

The thing is that CSS and JavaScript modes and their derivitives actually do not honor global tab-width variable setting. They each have their own variables for setting the amount of spaces for indent.

I used the customization menu to set "Css Indent Offset" and "Js Indent Level" to 2 and saved my settings. That finally did the trick.

DO NOT expect something like this to work:

You'll probably still want to do that, but it's not enough to get these modes to work as expected.

Discuss This Topic

There are 0 comments in this discussion.

join this discussion

Like what you've read? You can check out my latest project at Generali.st.

Got a project of your own that you need help with? Let's talk