My only tab-related init.el config is:

(setq-default indent-tabs-mode nil) ;; indentation can't insert tabs
(setq-default tab-width 4) ;; make tab-width 4 (spaces)

but in c-ts-mode I have that the indentation only does and works with 2 spaces (I need to indent-region whole file otherwise to fix it). How can I make this back to 4?

  • bttertone@alien.topB
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    I think you’re looking for ‘c-basic-offset’, although I’d echo the sentiment that you should use a formatter instead. For that you can check out the reformatter package, which lets you setup hooks based on the programming mode to invoke the formatter of your choice, e.g. setup a hook for c/c++ to use clang format or whatever you’d