I'm trying to configure Ctrl-Alt-Enter to insert a new top-level heading and the current date in the following format:
* [2023-02-07 Tue]
This is what I've come up with:
(defun heading-date ()
(interactive)
(org-insert-heading)
(insert (format-time-string "[%Y-%m-%d %a]"))
)
(global-set-key (kbd "C-M-return") 'heading-date)
However, when I press Ctrl-Alt-Enter I get this error in Emacs:
<C-M-return> is undefined
I've also tried reversing the order of C
and M
for experimentation's sake but of course that did not help:
(global-set-key (kbd "M-C-return") 'heading-date)
How can I capture the Ctrl-Alt-Enter combination to run this function?