From: Benoit Cerrina Date: 2001-11-07T17:21:01+09:00 Subject: [ruby-talk:24490] Re: Win32 VIM w/Ruby? "James Britt (rubydev)" wrote in message news:PGEPJIFLPEPOHCKEEEIKEEIACHAA.james@rubyxml.com... > I saw that Vim 6 supports an interface into Ruby, and I've managed to compile Vim with Ruby support on Linux, but cannot get it to > work on Windows (Win2K, specifically). > > Has anybody gotten it working on Windows? Having Ruby scripts to do my editor bidding would be rather cool, but most of my time is > spent on a windows box. > > Thanks, > > James > > Yes, yes, yes and it works great. ok first thing, what compiler do you use, it works great for me but and I use mingw32. I compiled vim with support for different versions of ruby and it works fine with dynamic loading but NOT without. here is the relevant part of the Make_ming.mak makefile: # Ruby interface: # RUBY=[Path to Ruby directory] # DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically) # RUBY_VER=[Ruby version, eg 16, 17] (default is 16) # RUBY_VER_LONG=[Ruby version, eg 1.6, 1.7] (default is 1.6) # You must set RUBY_VER_LONG when change RUBY_VER. RUBY=c:\ruby DYNAMIC_RUBY=yes # # Support Ruby interface # ifdef RUBY # Set default value ifndef RUBY_VER RUBY_VER = 16 endif ifndef RUBY_VER_LONG RUBY_VER_LONG = 1.6 endif ifndef RUBY_PLATFORM RUBY_PLATFORM = i386-cygwin endif RUBY_INSTALL_NAME = cygwin-ruby$(RUBY_VER) #RUBY_OBJ = $(OUTDIR)\if_ruby.obj RUBYINC =-I $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/$(RUBY_PLATFORM) ifndef DYNAMIC_RUBY RUBYLIB = -L$(RUBY)/lib -l$(RUBY_INSTALL_NAME) endif I actually only changed two lines RUBY=c:\ruby and DYNAMIC_RUBY=yes. there is a little gotcha though if you try to use the cygwin version of ruby (yes always problem with this one). defines.h line 36 requires a file called win32/win32.h because it found the NT flag (which I guess wasn't set when the distribution was compiled), this file is not distributed with the binary version, AND it conflict with another win32/win32.h file at least on my install. So I copied other the win32 directory in the ruby SOURCE distribution, changed the win32.h filename to win32ruby.h and changed the include accordingly, then all worked like a charm. Finally, please find here an experimental patch for vim which I'd like you to try please.. This enhances the vim support for ruby and allows you to use ruby methods as if they were vim functions and vice-versa. Details are found in the attached help file and there is a sample vim file with tests for the new functionalities. http://benoitcerrina.dnsalias.org/dev/vim/scriptPatch/RubyPatch.zip if you have any problem downloading (this is my home machine) please tell me and I'll post it on vim online. Benoit PS: if you have anymore problems compiling vim with ruby support on NT contact me.