I am using js2-mode to edit Javascript in Emacs, but I can't seem to get it to stop using tabs instead of spaces for indentation. My other modes work fine, just having issues w/ js2.
If you want to remove tabs in an existing file, mark the whole buffer using C-x h and use M-x untabify .
This is because standard tabs are set to eight spaces. Tabs are special characters.
To manually insert a tab in Emacs, use ctrl-Q TAB. control-Q causes the next key to be inserted rather than interpreted as a possible command.
Do you have
(setq-default indent-tabs-mode nil)
in your .emacs? It works fine for me in emacs 23.0.60.1 when I do that. js2-mode uses the standard emacs function indent-to, which respects indent-tabs-mode, to do its indenting.
Add this to your .emacs
file somewhere after you load js2 mode:
(setq js2-mode-hook '(lambda () (progn (set-variable 'indent-tabs-mode nil))))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With