【发布时间】:2014-12-08 22:03:53
【问题描述】:
我打开了一个名为 test.scss 的文件,当我在一行上按 RET 时,emacs 会在当前行添加 2 个空格,在下一行添加 4 个额外空格。
我用whitespace-mode 突出显示了文件的外观。
在按 RET 之前
按 RET 后
可以看到.my-element行自动缩进2个空格,新行缩进4个空格太多了。
我希望输出看起来像这样
想要的输出
我可以做些什么来让 emacs 产生我想要的输出?
这是describe-mode的输出:
Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption
Electric-Indent File-Name-Shadow Font-Lock Global-Eldoc
Global-Font-Lock Line-Number Menu-Bar Tooltip Whitespace
(Information about these minor modes follows the major mode info.)
SCSS mode defined in `css-mode.el':
Major mode to edit "Sassy CSS" files.
In addition to any hooks its parent mode `css-mode' might have run,
this mode runs the hook `scss-mode-hook', as the final step
during initialization.
虽然在这种情况下我处于 scss 模式,但我看到与我使用的大多数其他模式类似的行为,例如 ruby-mode、sgml-mode、js.el 模式等。我想让行为与上面显示的期望输出相匹配。
【问题讨论】:
标签: emacs indentation major-mode