Recently I've been using electric indent mode to handle automatic indentation. It's very useful when writing code, as it indents blocks automatically when the enter key is pressed. But some of that behaviour isn't desirable when using other modes, such as org mode.
One thing I like about org-mode is the keyboard shortcuts for inserting new
headlines and todo items. For example,
ALT+ENTER will create a new headline beneath the
current line at the correct depth.
Unfortunately, when using electric indent the headlines are indented:
Thankfully the solution is relatively simple. The following code in your emacs intialization will disable electric indentation when working with org files.
(add-hook 'electric-indent-functions (lambda (x) (when (eq 'org-mode major-mode) 'no-indent)))
So now you'll get the expected behaviour: