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?


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.

  • 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 8 '17 at 9:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.