C-j
used to newline-and-indent, now it doesn't indent anymore, but RET
does. Now since I upgraded to Emacs 24 they are swapped. Is there any way to revert this?
Asked
Active
Viewed 1,321 times
6

Andreas Jansson
- 243
- 1
- 10
-
Related: [Completely disable all auto-indentation](http://emacs.stackexchange.com/q/14297/115) – Kaushal Modi Jul 31 '15 at 20:11
1 Answers
3
You can simply bind the keys to the functions you want, by adding this code to your init file:
(global-set-key (kbd "C-j") #'newline-and-indent)
(global-set-key (kbd "<return>") #'newline)
You might want a different function for return
, depending on your desired behavior.

zck
- 8,984
- 2
- 31
- 65
-
with this I cannot use C-x b anymore because pressing return instead of selecting the file, emacs adds a newline to the minibuffer – Nisba Aug 08 '17 at 09:28