PATCH: matchit support for ftplugin/ruby.vim

Gavin Sinclair gsinclair at soyabean.com.au
Wed Sep 17 02:47:20 EDT 2003


This was taken from Ned Konz's plugin
(http://bike-nomad.com/vim/ruby.vim), permission pending :)  Thanks
to Hugh Sasse for bringing it to my attention.

I haven't tested it myself, but it's in pretty common use.

Cheers,
Gavin


--- ruby.vim    18 Aug 2003 09:52:48 -0000      1.4
+++ ruby.vim    16 Sep 2003 16:06:45 -0000      1.5
@@ -1,7 +1,7 @@
 " Vim filetype plugin
 " Language:    Ruby
 " Maintainer:  Gavin Sinclair <gsinclair at soyabean.com.au>
-" Info:                $Id: ruby.vim,v 1.4 2003/08/18 09:52:48 dkearns Exp $
+" Info:         $Id: ruby.vim,v 1.5 2003/09/16 16:06:45 gsinclair Exp $
 " URL:         http://vim-ruby.sourceforge.net
 " Anon CVS:    See above site
 " Licence:     GPL (http://www.gnu.org)
@@ -11,6 +11,10 @@
 "    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 "    GNU General Public License for more details.
 " ----------------------------------------------------------------------------
+"
+" Matchit support thanks to Ned Konz.  See his ftplugin/ruby.vim at
+"   http://bike-nomad.com/vim/ruby.vim.
+" ----------------------------------------------------------------------------

 " Only do this when not done yet for this buffer
 if (exists("b:did_ftplugin"))
@@ -18,7 +22,14 @@
 endif
 let b:did_ftplugin = 1

-" There are no known setting particularly appropriate for Ruby.  Please
-" contact the maintainer if you think of some.
+" Matchit support
+if exists("loaded_matchit")
+  if !exists("b:match_words")
+    let b:match_ignorecase = 0
+    let b:match_words =
+\ '\%(\%(\%(^\|[;=]\)\s*\)\@<=\%(class\|module\|while\|begin\|until\|for\|if\|unless\|def\|case\)\|\<do\)\>:' .
+\ '\<\%(else\|elsif\|ensure\|rescue\|when\)\>:\%(^\|[^.]\)\@<=\<end\>'
+  endif
+endif

 " vim: ff=unix



More information about the vim-ruby-devel mailing list