On Sat, Jan 10, 2004 at 12:29:24AM +0900, Jamis Buck wrote:
> Well, a plug here for vim: it's got a script/plugin you can get that 
> allows you to specify keywords to bounce (via %) between--pretty 
> powerful, really.  So you can specify that you want to bounce between 
> def/end,
> begin/end, while/end, do/end, if/end, etc.  I find it invaluable.

Cool!

> If you're interested, you can get it at:
> 
>  http://www.vim.org/scripts/script.php?script_id=39

Actually, if you have a recent version of vim, the plugin (called
"matchit") is included in the installation, but not activated;
you can find it in the "$VIMRUNTIME/macros" directory.  

Here are the steps to install it and get it up and running for Ruby:

        1. create the following directories if they don't already exist:
                a. "$HOME/.vim"
                b. "$HOME/.vim/doc"
                c. "$HOME/.vim/ftplugin"
                d. "$HOME/.vim/plugin"

        2. copy matchit.txt into "$HOME/.vim/doc"

        3. copy matchit.vim into "$HOME/.vim/plugin"

        4. put a ruby.vim with appropriate matchit setup into
           "$HOME/.vim/ftplugin" (see below)

        5. add this line to your "$HOME/.vimrc":
        
               filetype plugin on

        6. Fire up vim and run this command to enable the matchit doc:

                :helptags ~/.vim/doc

        7. Then for more info, you can do this:

                :help matchit

The ftplugin/ruby.vim file needs to set b:match_words appropriately for
Ruby.  I'm using the line below, which so far is working fine for me,
but as I just now installed matchit after reading Jamis's message,
I haven't had time to test it thoroughly: 

        let b:match_words = '\<\(begin\|case\|catch\|do\|for\|if\|while\)\>:\<\(elsif\|when\)>:\(else\|ensure\):\<end\>'

Many thanks for the pointer, Jamis!

-Mark