使Emacs减少对缩进的侵略 [英] Make Emacs less aggressive about indentation
问题描述
当我输入某些东西时,Emacs会重新输入当前行,如;要么 //。这是非常烦人的,因为有很多地方,它不够聪明,无法正确缩进。
Emacs reindents the current line whenever I type certain things, like ";" or "//". This is pretty annoying, since there are a whole lot of places where it isn't smart enough to indent correctly.
如何禁用此功能?我仍然希望能够使用TAB缩进行,但是我不希望我输入任何源代码来重新生成。
How do I disable this feature? I still want to be able to indent the line with TAB, but I don't want any source code I type to cause it to reindent.
(我正在使用Dylan Moonfire的C#模式,但这可能适用于任何cc模式。)
(I'm using Dylan Moonfire's C# mode, but this probably applies to any cc-mode.)
推荐答案
尝试运行 c-toggle-electric-state 关闭这些字符的电动作
Try running c-toggle-electric-state to turn off the electric action of these characters.
您可以将其作为c-mode-common-hook的一部分,或者通过点击 Cc Cl $手动切换状态c $ c>。
You can do this as part of a c-mode-common-hook, or toggle the state manually by hitting C-c C-l
.
这篇关于使Emacs减少对缩进的侵略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!