emacs - 如何在每个新文件中将 Emacs 选项卡设置为空格?

标签 emacs coding-style indentation convention

我想要一个 .emacs 设置,以便制表符始终由连续的空格组成。最好在每种可能的模式中。在其他编辑器中,这似乎从来都不是问题,但在 .emacs 中,我害怕使用选项卡。

最佳答案

在您的 .emacs 中添加:

(setq-default indent-tabs-mode nil)

或者你可以定义一个 before-save-hook 来消除硬标签

关于emacs - 如何在每个新文件中将 Emacs 选项卡设置为空格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1012855/

相关文章:

java - 整洁的代码 - 如何破坏返回 String 的方法

emacs - 如何在 Emacs 中以 Markdown 模式通过 TAB 或 4 个空格向内缩进文本 block ?

PHP 正确缩进?

Emacs 特定区域只读

html - Emacs 组织模式 : specify raw area for HTML exporter

emacs - 在 Emacs 中逐步向后导航位置历史记录

python - a, b = b, a + b 是好的 python 吗?

ruby - 为 Rubocop 重构两层以上的 block 嵌套

latex - LaTeX “\indent”创建段落缩进/制表符包要求吗?

c - 如何同时交换或替换代码中的多个字符串?