Better autocomplete in VIM

Warren Wright picture Warren Wright · Mar 30, 2013 · Viewed 13.3k times · Source

All,

I have been working with vim for some time now, and love everything about it - there is only one thing I really miss from IDEs like RubyMine, and that is advanced autocompletion.

For reference, here is my standard VIM setup: https://github.com/wrwright/.vim

I have tried ctags with omnicomplete + supertab, and the one major element I miss is the ability to bring up a context sensitive list of attributes/constants/methods. For example, as I learn RubyMotion, I'd love to have some help remembering iOS SDK constants/attributes/methods, but my VIM autocomplete stops with suggesting class names..or if it does suggest methods/attributes, it lists a ton of methods/attributes that don't even apply to the class I'm working with.

I'd like to (simple example) be able to type UIColor.bl and have it autocomplete with UIColor.blueColor (or suggest if there are multiple options that start with "bl" that are properties of UIColor.

RubyMine does this very well, and if I can get VIM to be similarly smart with autocomplete it would be heavenly (and a great boon while learning RubyMotion/iOS Development.

I have also tried SnipMate (and even a RubyMotion tailored variation at https://github.com/rcyrus/snipmate-snippets-rubymotion), but that doesn't seem to offer the features I'm looking for either.

Answer

David Unric picture David Unric · Mar 30, 2013

Relatively satisfied with stock Vim's omnicomplete + vim-ruby and vim-rails having completion abilities on par with NetBeans but with all the bells&whistles of Vim and much lower resource requirements, of course.

From my .vimrc concerning completion options :

autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1 
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1