All the code completion functionality provided by eclim (ant, java, etc) makes use of the new "User Defined Completion" added to Vim 7. To initiate code completion enter insert mode and type Ctrl-X Ctrl-U. By default Vim will open a popup if there is more than one completion.
Note
If you would prefer to have eclim use vim's omni code completion instead, you can add the following to your vimrc:
let g:EclimCompletionMethod = 'omnifunc'
When using omnifunc you will use Ctrl-X Ctrl-O to start code completion.
Example with java completion
Once you have started the completion you can use Ctrl-N to proceed to the next match and Ctrl-P to move to the previous match.
If you are like me and you find those key strokes a bit cumbersome, then you can use the SuperTab plugin which allows you to use the Tab key for completion.
Another option, which can be used in lieu of or with SuperTab, is the AutoComplPop plugin, which will automatically trigger code completion as you type.
AutoComplPop by default only supports triggering code completion for file types who have an omni completion that ships with vim, but you can configure it to support eclim code completion. Here is an example of some vim script you can add to your vimrc to enabled AutoComlPop for java file types (this example will trigger the completion popup when at least 3 characters have been typed after a dot, but you can tweak this to your tastes):
let g:acp_behaviorJavaEclimLength = 3
function MeetsForJavaEclim(context)
return g:acp_behaviorJavaEclimLength >= 0 &&
\ a:context =~ '\k\.\k\{' . g:acp_behaviorJavaEclimLength . ',}$'
endfunction
let g:acp_behavior = {
\ 'java': [{
\ 'command': "\<c-x>\<c-u>",
\ 'completefunc' : 'eclim#java#complete#CodeComplete',
\ 'meets' : 'MeetsForJavaEclim',
\ }]
\ }
To find out more about Vim's insert completion execute the following from within Vim:
:h ins-completion