How to disable auto-indexing in a new line in js2 mode?

I am editing React .jsx files and I do not want to backtrack in a new line, how to disable it?

+5
source share
2 answers

Mx electric-indent-local-mode should do this if you are using Emacs-24.4.

+8
source

In Emacs 25.1.1, setting electric-layout-mode to -1 seems to work. So in js2-mode-hook add:

(add-hook 'js2-mode-hook (lambda() (electric-layout-mode -1)))

0
source

Source: https://habr.com/ru/post/1216393/


All Articles