Since a few months, whenever I start Emacs, the first thing I do is to type "Esc-x electric-indent-mode" to turn off automatic indentation in .tex, .html and .m files that was driving me crazy. I am very happy with the effect but getting tired of having to type "Esc-x electric-indent-mode". I am looking for a way to save this setting as a default. Searching on the internet leads to dozens of pages that tell me I should not turn of automatic indentation, I really shouldn't; I should perhaps subtly change its behaviour in certain modes but whatever I do, I should not totally turn it off. I do not care. I just want to turn the electric indent mode off by default. Why does that seem to be so difficult?
Asked
Active
Viewed 15 times
0
-
https://stackoverflow.com/q/21182550/1030675 – choroba Jun 15 '22 at 07:53
-
It's not entirely clear to me whether you definitely want to turn the mode off globally, or if you only really want it disabled for ".tex, .html and .m files"; but as the Q&A linked by @choroba covers both of those cases (the former is shown in the question, the latter by its answers), I've closed this as a duplicate. – phils Jun 15 '22 at 10:30
-
Globally, globally, globally. I have been using Emacs as a text editor since the mid 1990ies but it has become increasingly complicated. To be honest, I do not understand the answers that you linked to. It is clearly the problem I have (thanks for finding this!) but I have no idea where I am suppose to type texts like: (add-hook 'yaml-mode-hook (lambda () (electric-indent-mode -1))). Apparently, I first have to learn what a hook is (and maybe many more things I have never heard off). Emacs used to be a nice text editor but nowadays it seems to be for programmers only. – Jan Swart Jun 16 '22 at 20:20