omni-completion refresh

Jarmo jarmo.p at
Sat Dec 25 12:44:35 EST 2010


I've finally got Ruby code completion working sort of, but not as i'd really
like it. Currently it doesn't show the new methods added to some class if
code-completion has already used. For example, if i have files like these:

# a.rb
class A
  def my_method

# b.rb
require "a"
a =
a. # <C-x><C-o> will show my_method

Now if i open a.rb in a separate buffer and add some new method and save the
file then again in the b-buffer omni-completion doesn't show the newly added
method. I have to restart vim to make it show me the new method too. Is it
possible to make vim reload the omni-completion data?

In my vimrc i have currently these lines:
autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1

Also, when i use modules then the omni-completion doesn't seem to work at
all - even if i restart vim:
# a.rb

module MyModule
  class MyClass
    def my_method

# b.rb
MyM #<C-x><C-o> shows no matches
MyModule::MyC #<C-x><C-o> shows no matches
a =
a. #<C-x><C-o> shows no matches

To conclude i have two problems:
1) how to refresh omni-completion data?
2) how to make omni-completion work with module namespaces?

I'm relatively new to vim so please apologize for my ignorance.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the vim-ruby-devel mailing list