当我在基本模式下按Tab键时,我无法让emacs版本24.3缩进两个空格。我还读了很多其他的帖子,比如set 4 Space Indent in Emacs。我非常确定这在以前的emacs版本中是有效的:
(setq tab-width 2)
(setq indent-tabs-mode nil)我现在正在尝试所有这些:
(setq tab-width 2)
(setq-default tab-width 2)
(setq indent-tabs-mode nil)
(setq-default indent-tabs-mode nil)
(setq indent-line-function 'insert-tab)
(setq tab-stop-list (number-sequence 2 400 2))现在我发现制表符缩进到该行的第一个空白块之后
this is my first line
second line starts here我想不出怎么把它变得简单
this is my first line
second line starts here也许问题出在我的配置上?我已经在我自己的用户主目录中安装了这个新版本的emacs -它不是系统范围的emacs版本。
发布于 2013-06-20 11:38:06
实际上,你的“我现在正在尝试所有这些”的配置工作得很好:
(setq-default tab-width 2)
(setq-default indent-tabs-mode nil)
(setq indent-line-function 'insert-tab)
(setq tab-stop-list (number-sequence 2 400 2))如果你把你的init文件缩小到这样,它应该会像你期望的那样工作。
你可能在你的配置中的其他地方破坏了这些设置?
发布于 2013-06-20 21:56:19
如果你想改变“当我点击的时候”的行为,首先要做的就是做C-h k <foo>。这将告诉您哪个命令正在运行,并可能为您提供有关如何更改其行为的进一步提示。TAB键的行为取决于主模式,因此让它执行您想要的操作取决于您使用的主模式。如果你正在使用fundamental-mode,你不会以正常的方式使用Emacs,所以我建议你先试着修复它。
https://stackoverflow.com/questions/17204317
复制相似问题