Emacs에서 탭 대신 공백을 사용하도록 js2 모드를 얻으려면 어떻게 해야 합니까?
-
09-06-2019 - |
문제
나는 사용하고있다 js2 모드 Emacs에서 Javascript를 편집하려고 하는데 들여쓰기에 공백 대신 탭을 사용하는 것을 중지할 수는 없는 것 같습니다.다른 모드는 잘 작동하지만 js2에 문제가 있습니다.
해결책
당신은 가지고 있습니까?
(setq-default indent-tabs-mode nil)
당신의 .emacs에?그렇게 하면 emacs 23.0.60.1에서 잘 작동합니다.js2-mode는 들여쓰기를 위해 indent-tabs-mode를 준수하는 표준 emacs 함수 indent-to를 사용합니다.
다른 팁
이것을 당신의 .emacs
js2 모드를 로드한 후 어딘가에 파일을 저장하세요.
(setq js2-mode-hook
'(lambda () (progn
(set-variable 'indent-tabs-mode nil))))
내 GNU Emacs 24.2.1 사본에서 다음을 설정합니다.
(setq-default indent-tabs-mode nil)
.emacs에서는 javascript 모드에는 충분하지 않습니다. 아마도 버퍼별 컨텍스트에서 설정이 어떻게든 무시되고 있기 때문일 것입니다.다음 변경으로 충분합니다.
(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))
제휴하지 않습니다 StackOverflow