reddit / emacs

Emacs with Java

PortalToTheWeekend · 2022-09-16 03:10
So I have been able to get the LSP for Java working and I have autocomplete functionality and such. The one issue I have is that for some reason when I make a new ‘{‘ it will auto type the ‘}’ but when I hit enter to start typing the function the newline begins at the very beginning of the line. It does not respect the tabbing for the Java function and auto tab? I’ve tried a couple different things but nothing seems to work? How can I get it so that I don’t have to manually tab the }?
MitchellMarquez42 · 2022-09-16 03:26
Was one of the things you tried `electric-indent-mode`? That should be the basic feature to enable.
PortalToTheWeekend · 2022-09-16 05:58
Oh no actually I haven’t tried that. How do I enable it?
MitchellMarquez42 · 2022-09-16 06:01
Manually: M-x electric-indent-mode In init file, for all programming languages: (add-hook 'prog-mode-hook #' electric-indent-mode)