How to change the indentation width in emacs javascript mode

js-indent-level can be used in the default javascript-mode, which is included by default starting in emacs 23.2.

(setq js-indent-level 2)

should do what you’re looking for. If you’re using an older version of emacs, you may be in java-mode. I think this mode responds to c-basic-offset, however I may be wrong.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)