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?

You are viewing a single thread.
View all comments
1 point

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

permalink
report
reply
1 point

c-basic-offset did not work. that was the first thing i tried.

permalink
report
parent
reply

Emacs

!emacs@communick.news

Create post

A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!

Get Emacs

  • Windows
  • Mac OS X
  • GNU/Linux and BSD (Just get it from your distribution’s package manager)

Rules

  1. Posts should be emacs related
  2. Be kind please
  3. Yes, we already know: Google results for “emacs” and “vi” link to each other. We good.

Emacs Resources

Emacs Tutorials

Useful Emacs configuration files and distributions

Quick pain-saver tip

Community stats

  • 18

    Monthly active users

  • 562

    Posts

  • 2.4K

    Comments