How to insert a new line and jump to it, in emacs?
C-e C-m
or
C-e C-j
Both will move to end of the line and add newline. The second will also indent.
For completeness here is a function:
(defun end-of-line-and-indented-new-line ()
(interactive)
(end-of-line)
(newline-and-indent))
(global-set-key (kbd "<S-return>") 'end-of-line-and-indented-new-line)
You can make something akin to a keyboard macro like this.
(global-set-key (kbd "<S-return>") "\C-e\C-m")
or indeed:
(global-set-key (kbd "<S-return>") (kbd "C-e C-m"))
to avoid using two different kinds of syntax for keys.