5

A tabified file showing spaces and tabs

This is what javascript-mode generates with standard tabbing (I never hit the space key when making it). I'd like to have the files contain no tab characters. I can't seem to find any option in the Easy Customization mode.

Drew
  • 75,699
  • 9
  • 109
  • 225
Shelvacu
  • 153
  • 5

1 Answers1

7

The buffer-local indent-tabs-mode variable controls this (in general, for any mode).

Note that javascript-mode is an alias for js-mode, so there isn't a javascript-mode-hook.

(defun my-js-mode-hook ()
  "Custom `js-mode' behaviours."
  (setq indent-tabs-mode nil))

(add-hook 'js-mode-hook 'my-js-mode-hook)
phils
  • 48,657
  • 3
  • 76
  • 115