In C/l-mode F1 v indent-tabs-mode prints:

indent-tabs-mode is a variable defined in `C source code'.
Its value is nil
Original value was t
Local in buffer nir_types.cpp; global value is t

But pressing the tab key still replaces the spaces used for indentation with tabs.

1 Answer 1


Turns out it was smart-tabs-mode which was making life miserable as I have it turned on by default in my init.el.

Turning it off locally for the specific project solved all my troubles. I.e. in .dir-locals.el in the source code parent folder I wrote:

  (indent-tabs-mode . nil)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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