Emacs newline-and-indent in scala-mode

I have (global-set-key (kbd "RET") 'newline-and-indent)in my .emacs, which works fine in all modes, but scala-mode (the newest, version 19295 from svn).

What do I need to change to make it work?

+3
source share
2 answers
(add-hook 'scala-mode-hook
      (lambda () (local-set-key (kbd "RET") 'reindent-then-newline-and-indent)))

The above problem fixes the problem. Now it pushes the line correctly after pressing Enter once, but still does not work if there is an empty line on the new line.

+3
source

scala -mode "RET" scala -newline , global-set-key, , , scala -mode, :

(add-hook 'scala-mode-hook
      (lambda () (local-set-key (kbd "RET") 'newline-and-indent)))

:

(add-hook 'scala-mode-hook
      (lambda () (local-set-key (kbd "RET") 'reindent-then-newline-and-indent)))

, Emacs .

+1

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


All Articles