如何使emacs与制表符上的其他编辑器执行相同的操作?

时间:2010-12-30 14:20:55

标签: emacs emacs23

emacs中的TAB键绑定到indent-for-tab-command,但缩进本身会将所有选项卡转换为空格,我不喜欢这些空格,因为在代码中找到字符更难,代码变大

我尝试使用(setq-default indent-tabs-mode t),(setq tab-width 4)或(setq default-tab-width 4),以上都不起作用。 \ t \ t字符的宽度都不会更改,缩进也不会使用制表符而不是空格。 并且'M-x tabify'也不起作用。

我搜索了很长时间但几乎什么都没有。有什么想法吗?

1 个答案:

答案 0 :(得分:3)

这是您的.emacs设置,如果您的.emacs文件中没有任何特殊设置,则默认情况下应插入标签。

;; This will force emacs to insert spaces instead of tabs
(setq-default indent-tabs-mode t)

其他两个设置无关。

检查emacswiki.org以查找与Emacs相关的任何问题。

相关问题