Salah Eddine Taouririt
Salah Eddine Taouririt

Reputation: 26405

How to disable auto-indentation on newline in js2-mode?

I'm editing React .jsx files, and I don't want to indent on newline, how to disable it?

Upvotes: 5

Views: 1113

Answers (2)

chief
chief

Reputation: 1

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

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

Upvotes: 0

Stefan
Stefan

Reputation: 28531

M-x electric-indent-local-mode should do it if you're using Emacs-24.4.

Upvotes: 9

Related Questions