pavelkor
pavelkor

Reputation: 79

Vim ruby autocomplete

I give up. This

 51   if !exists('g:neocomplcache_omni_patterns')
 52        let g:neocomplcache_omni_patterns = {}
 53   endif
 54
 55   if !exists('g:neocomplcache_omni_functions')
 56        let g:neocomplcache_omni_functions = {}
 57   endif
 58   let g:neocomplcache_omni_patterns['ruby'] = '[^. \t]\.\w*'
 59   let g:neocomplcache_omni_functions['ruby'] = 'rubycomplete#Complete'
 60   autocmd FileType ruby set omnifunc=rubycomplete#Complete

is a part of my .gvimrc file.

The problem is that I can't setup omni autocompletion for ruby. If I type C-x C-y it works, but not while I'm writing code. It works fine for php, html, css etc

Upvotes: 2

Views: 6254

Answers (1)

David Unric
David Unric

Reputation: 7719

although I don't use neocomplcache I'm fairly satisfied with vim-ruby, including code-completion. Just having Vim compiled with ruby support, added to .vimrc

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

As highly dynamic nature of Ruby, the code completion will be always limited to some degree, but above really helps with completion of standard classes and methods, even most of your own.

Upvotes: 7

Related Questions