防止以表达式开头的行上的自动缩进

时间:2015-12-14 16:05:00

标签: emacs indentation

我正在使用emacs,但我对缩进设置有疑问。

每当我使用private void button1_Click(object sender, EventArgs e) { DateTimePicker1.CustomFormat = "MM/dd/yyyy hh:mm tt"; DateTimePicker1 .Value = new DateTime(DateTimePicker1.Value.Year, DateTimePicker1.Value.Month, DateTimePicker1.Value.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); } 开始一行时,它会自动缩进该行。我不希望这种情况发生。

我可以配置此行为吗?我怎么能这样做?

1 个答案:

答案 0 :(得分:1)

Each major mode has its own indenting behavior, so in general you need to know which major mode you're using (C-h v major-mode or C-h m), and the way to change the behavior is major mode dependent.

However, I'm going to guess that this is electric-indent-mode (C-h f electric-indent-mode). You can toggle it with M-x electric-indent-mode or M-x electric-indent-local-mode, or customize its variables.

相关问题