Sunday, April 6, 2025

Setting Javascript Identation in Emacs

 To set the indent width when editing Javascript files in Emacs, set the variable js-indent-level to the desired width.  This can be done by calling setq in the init file, but these days I just invoke the describe variable function by C-h v, then customize the variable there, this also sets the variable in the init file.

  1. C-h v
  2. js-indent-level [Enter]
  3. Focus on the customize link and hit enter
  4. Chang the indent value in the customize page
  5. Focus on the Apply and Save button and hit enter