emacs:如何关闭自动缩进?

问题描述 投票:2回答:1

有人可以告诉我如何在emacs中关闭自动缩进吗?

我尝试过的是推荐-

  (when (fboundp 'electric-indent-mode)
    (electric-indent-mode -1))

在我的模式钩中,这不起作用。也不起作用的是设置(electric-indent-mode 0)。而且,我(setq electric-indent-inhibit t)的方法也无助于切换电子缩进。

什么是正确的方法?

assembly emacs indentation auto-indent
1个回答
1
投票

对于nasm-mode,我只需在我的模式挂钩中调用(electric-indent-local-mode -1),就足够了。

对于asm-mode,默认情况下它将RET绑定到newline-and-indent,因此您可以将键重新定义为(define-key asm-mode-map (kbd "RET") #'newline)并在模式挂钩中禁用electric-indent-local-mode

© www.soinside.com 2019 - 2024. All rights reserved.