我正在使用js2-mode在Emacs中编辑Javascript,但是我似乎不能让它停止使用制表符而不是空格来缩进。我的其他模式工作得很好,只是js2有问题。
发布于 2011-11-01 01:26:04
加载js2模式后,将此代码添加到.emacs文件中的某个位置:
(setq js2-mode-hook
'(lambda () (progn
(set-variable 'indent-tabs-mode nil))))发布于 2015-05-24 02:12:06
在我的GNU Emacs 24.2.1副本上,设置:
(setq-default indent-tabs-mode nil)对于javascript模式,在.emacs中是不够的,大概是因为该设置在每个缓冲区的上下文中以某种方式被覆盖了。下面的更改就足够了:
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(indent-tabs-mode nil))https://stackoverflow.com/questions/45861
复制相似问题