CodeMirror: Autocomplete demo

Press ctrl-space to activate autocompletion. See the code (here and here) to figure out how it works.