Skip to content

Overriding tab setting for hard tabbed file #46

@ambihelical

Description

@ambihelical

I have a source tree which uses hard tabs for indentation and which assumes tab width is a value different than my default tab-width (as set up in init.el). I'd like to tell dtrt-indent via .dir-locals.el to set that tab-width and let it set any related variables (e.g. evil-shift-width). I've failed so far to do this.

If I set tab-width in .dir-locals.el, that sets only tab-width, dtrt-indent seems to use my default values for everything else.I get the same result by setting c-basic-offset.
Here is the messages I get for dtrt-indent in both cases (I am trying to set tab width to 3 via .dir-locals.el, my init.el sets tab-width and evil-shift-width to 4, I don't set c-basic-offset at all):

Note: c-basic-offset, evil-shift-width adjusted to 4
Note: indent-tabs-mode adjusted to t

Is there a way to do this?

Here is my setup for dtrt-indent:

(use-package dtrt-indent
  :hook (( prog-mode text-mode ) . dtrt-indent-mode)
  :init
  (setq dtrt-indent-run-after-smie t)
  :config)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions