I would like to change the shortcut defined for org-insert-heading (in org-mode, in emacs).
It is M-<RET>
and I would like to have C-c C-j
(like in AUCTex mode).
How do I do this (there is no variable in org-customize) ?
As an alternative to erikstokes' answer, you can use define-key
with the appropriate keymap. Set this in your .emacs.d/init.el
:
(define-key org-mode-map (kbd "C-c C-j") 'org-insert-heading)
This will add it to the org-mode keymap, and it will not add the key locally every time the mode is set to org-mode
(it shouldn't matter, but running it on every hook can cause issues for some commands.
You just need to bind C-c C-j
to the function you want. Assuming that you only want it bound this way in org-mode, add
(add-hook 'org-mode-hook
'(lambda ()
(local-set-key "\C-c\C-j" 'org-insert-heading)
))
to your .emacs
file and restart Emacs (or just reload your .emacs
). Now every time you load a file in org-mode the local-set-key
function will be run and set the keys the way you want.
You could have a look at "org-auctex-keys.el", a minor mode which I created to offer AUCTeX key bindings within Org documents.
Check it out at https://github.com/fniessen/org-auctex-key-bindings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With