2

How do I make it so tabs are used instead of spaces when TAB is pressed? I've tried setting indent-tabs-mode to t but no dice.

On my other modes, such as php-mode and c-mode, tabs are inserted. CSS mode seems to be ignoring.

God I hate spaces so much.

4

The built-in CSS mode should support this just fine by giving indent-tabs-mode a non-nil value.

Note that spaces will still be used for padding if the number of indentation spaces isn't a multiple of tab-width. The default values of tab-width and css-indent-offset are 8 and 4 respectively, so you'll need two levels of indentation before a tab is inserted.

I think what you want in this case is to set tab-width and css-indent-offset to the same value.

0

You might be out of luck with the built-in css-mode.el. There does not seem to be anything in the package code that allows using tab characters for indentation.

If you collaborate writing code, you are facing an uphill struggle as most people try to avoid tabs like plague. :)

However, EmacsWiki has (old) code for an other css-mode.el that has customisable variable css-tab-mode. Its effect is explained in function css-tab-function. You could try if its other features are good enough for you.

  • Well shit. Thanks for the information! – Sanchke Dellowar Jul 2 '17 at 13:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.