How to TAB to auto-complete with org-mode?

emacs, emacs-prelude, org-mode

Solution

Auto-complete uses the variable ac-modes to decide whether to enable auto-completion in a particular mode, by default `org-mode` is not present in this list. So to enable auto-completion in `org-mode` simply add it to the `ac-modes` something like this should work

(add-to-list 'ac-modes 'org-mode)

Also to complete using tab you will need to set `ac-trigger-key` to tab like so (link to the manual)

(ac-set-trigger-key "TAB")

Problem

I've installed `auto-complete-mode`, and I'm using org-mode. When I hit TAB to auto-complete words, it instead tries to indent the line. Sometimes it indents the whole paragraph, sometimes it does nothing. I tried customizing the variable `(setq tab-always-indent 'complete)` and changing it to nil, but now when I hit TAB, it just inserts tab spaces across the screen. I know it's possible to successfully use org-mode with yasnippet and auto-complete both working correctly, because with Emacs Live it works out of the box.

Original source