danchoi / ri.vim

browse ri documentation from Vim
http://github.com/danchoi/ri.vim
MIT License
114 stars 15 forks source link

define_method etc.. not working from Vim #5

Closed ivanoats closed 12 years ago

ivanoats commented 12 years ago

if I do from command line, I get:

ri define_method
= .define_method

(from ruby site)
=== Implementation from Module
------------------------------------------------------------------------------
  define_method(symbol, method)     -> new_method
  define_method(symbol) { block }   -> proc

------------------------------------------------------------------------------

Defines an instance method in the receiver. The method parameter
can be a Proc, a Method or a ...

but if I try it from within ri.vim, I get "No matches!"

Not sure why, ideas?

danchoi commented 12 years ago

Try this from within Vim:

:!ruby ~/.vim/plugin/ri_vim.rb define_method

You should see something like this:

Press ENTER or type command to continue
define_method            Module#define_method
define_method__attribute ActiveRecord::AttributeMethods::DeprecatedUnderscoreRead::ClassMethods#define_method__attribute
define_method_attribute  ActiveRecord::AttributeMethods::PrimaryKey::ClassMethods#define_method_attribute
define_method_attribute  ActiveRecord::AttributeMethods::Read::ClassMethods#define_method_attribute
define_method_attribute= ActiveRecord::AttributeMethods::TimeZoneConversion::ClassMethods#define_method_attribute=
define_method_attribute= ActiveRecord::AttributeMethods::Write::ClassMethods#define_method_attribute=
ivanoats commented 12 years ago

yes, thanks, that's what I see. FWIW, my path is:

!ruby ~/.janus/ri.vim/plugin/ri_vim.rb define_method
danchoi commented 12 years ago

What path is ri.vim on when you type :scriptnames?

ivanoats commented 12 years ago

~/.janus/ri.vim/plugin/ri.vim

BTW, just found kindlefeeder.com, brilliant idea, nice work!

danchoi commented 12 years ago

Thank you about kindlefeeder.

What happens if you re-source the ri.vim script with :source ~/.janus/ri.vim/plugin/ri.vim and try the lookup again?

sunaku commented 12 years ago

No luck after manually re-sourcing here.

danchoi commented 12 years ago

OK I think I figured it out. Please update the ri.vim and ri_vim.rb files in your plugin directory and try it out.

ivanoats commented 12 years ago

works! thanks!