首页 > 解决方案 > emacs:如何关闭自动缩进?

问题描述

谁能告诉我如何关闭自动缩进emacs

我尝试的是推荐的-

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

在我的模式挂钩中不起作用。什么也不行是设置(electric-indent-mode 0)。而且,我的方法也没有帮助切换电动缩进(setq electric-indent-inhibit t)

什么是正确的方法?

标签: assemblyemacsindentationauto-indent

解决方案


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

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


推荐阅读