r/evilmode • • Jan 05 '21

Orgmode: Automatically enter Insert mode when creating a new heading or list item.

When creating a new heading or list item with Alt-Enter it seems only natural that Evil should be in Insert mode, much how o and O add a line and leave the user in Insert mode.

How can this be configured? I'm on Emacs 26.3, Kubuntu 20.04.

7 Upvotes

7 comments sorted by

View all comments

Show parent comment

1

u/tuh8888 Jan 30 '21

Rebind the key you wanted to use with the function provided by the top comment. Add this after where you defined the function.

(define-key 'org-mode-map (kbd "M-<return>") #'cld/org-insert-header)

1

u/dotancohen Feb 03 '21

Thank you. No matter how simple I configure the file I am unable to get Emacs into Insert mode after Alt-Return.

I'm sure the problem is in my lack of understanding of Emacs configuration. Though even copying the code verbatim via copy-paste (something I loathe to do, because then one doesn't learn) it doesn't behave as expected.

I've poured tons of time into this, I will have to simply revisit the topic at a later time once I learn more about Emacs. Thank you for your help.