Some comments and questions on the VimRubySupport wiki page

Sam Roberts sroberts at
Sun May 2 15:08:40 EDT 2004

Here's the page, my comments are inline:

> <h3>Special files that come with Vim</h3>
> When you install Vim 6.1 (please don't use 5.x if you can help it!), the following important files are created (<tt>$VIMRUNTIME</tt> is the directory where Vim is installed, like <tt>/usr/share/vim/vim61</tt> or <tt>C:\Program Files\vim\vim61</tt>):
> * <tt>$VIMRUNTIME/syntax/ruby.vim</tt>
> * <tt>$VIMRUNTIME/indent/ruby.vim</tt>
> * <tt>$VIMRUNTIME/ftplugin/ruby.vim</tt>


- in ftplugin/ruby.vim sw=2, so why not tabstop=2? I usually think of
  the two working in tandem.

This list doesn't mention:

* <tt>$VIMRUNTIME/compiler/ruby.vim
* <tt>$VIMRUNTIME/compiler/rubyunit.vim

I guess they don't actually come with vim, now, but maybe soon? And they
are in cvs, and incredibly useful (though I'm having trouble useing them
:-( see below).

> <h3>Customising</h3>
> You can complement the system-wide settings with plugins places within your home directory.  Inside the directory <tt>.vim</tt> (Unix) or <tt>vimfiles</tt> (Windows) exists the same directory structure as in <tt>$VIMRUNTIME</tt>: in particular, the subdirectories <tt>syntax</tt>, <tt>indent</tt>, and <tt>ftplugin</tt>.  If you put a file <tt>ruby.vim</tt> in any of these directories, you can tailor the way Vim treats Ruby files to your own needs.

Spelling------------------------------------------------- "placed"

> I see no need to tamper with syntax highlighting or indenting, but being able to have Vim load up a special configuration file whenever a Ruby file is loaded is a great benefit.  In fact, it can load more than one file.  Here are the three important files that Vim loads whenever I edit a Ruby program:
> * vimfiles/ftplugin/ruby.vim
> * vimfiles/ftplugin/ruby_matchit.vim
> * vimfiles/ftplugin/ruby_structure.vim
> You can see the pattern there.  When the filetype is "ruby", Vim will load any files like those above.

> In my directory, <tt>ruby.vim</tt> sets textwidth, softtabstop, and shiftwidth.  That's it.  (These are inappropriate for the system-wide ftplugin, because they reflect user preferences.)

Maybe add something like:

  In order to enable the support in ../compiler/ruby.vim and
  ../compiler/rubyunit.vim, you can also add:
  compiler ruby

  to your ~/.vim/ftplugin/ruby.vim

But, there are some wrinkles with this:

- I want BOTH error formats, the one for rubyunit, and the one for ruby
  (since you can see both when you run unit tests!), how would I do

- If you want to use the "compiler" error formats, but NOT modify your
  make program (your programming language choice and your make program
  choice are orthogonal), how would you do this?

- by changing makepgr to ruby, it causes the appearance of a "hang" when
  one does ":make" (ruby, without arguments, tries to read stdin, so it
  just sits there).


More information about the vim-ruby-devel mailing list