[Haskell-cafe] auto-completion for Vim 7

Stephan Walter stephan at walter.name
Sun Mar 4 13:15:35 EST 2007


I started to write a Vim script for the new omni-completion feature of
Vim 7. If you use Vim you might want to check it out:

* download http://stephan.walter.name/files/haskellcomplete.vim and
put it in ~/.vim/plugin
* :set omnifunc=haskellcomplete#CompleteHaskell
* press <c-x><c-o> to complete

(The advantage of omni-completion over normal completion using <c-n>
and <c-p> is that you can write you own function which does some smart
guessing to offer good completions)

So far the functionality is *very* limited. It will autocomplete a few
functions from the prelude as well as functions in the current file
that have a type declaration.

If you look through the source code of the script, you'll see that I
have included some function names and types from the standard
libraries. Before I continue this (rather tedious) work, I wanted to
know what the cafe patrons think about it.

If someone knows of a simple way to generate a function/type list of
the standard modules, I'd love to hear about it. Generating such a
list on the fly each time is probably not an option, as it would be
too slow.


More information about the Haskell-Cafe mailing list