Using js-mode's indent logic in js2-mode
Here's a somewhat hack-y workaround: switch to
indent-region and then switch back.
;; use js-mode's indent logic, by pressing C-M-| (C-M-S-\) (defun rlw/js-indent-region () (interactive) (js-mode) (indent-region (region-beginning) (region-end)) (js2-mode) ) (define-key js2-mode-map (kbd "C-M-|") 'rlw/js-indent-region)
- mooz's fork of js2-mode
- thomblake's js3-mode
- I think the defunct espresso-mode is now the built-in
- I'm not sure where that leaves
- Steve Yegge's js2-mode
The first two are supposed to address js2-mode's indentation problems (among other enhancements).