On Sat, 2002-02-09 at 19:29, Jim Freeze wrote:
> On Sun, Feb 10, 2002 at 01:54:01AM +0900, Michael Neumann wrote:
> > Martin Maciaszek wrote:
> > 
> > It's there! You can find Vim/Ruby related resources at
> > 
> >   www.rubygarden.org/ruby?VimExtensions
> > 
> > Or directly download a folding-enabled Vim 6.x sytax file at
> > 
> >   www.fantasy-coders.de/ruby/ruby.vim
> > 
> Uhmm, how to you get it to fold a function or class
> automatically without having to set the range?

If that file has folding-syntax like it should you should be able to use
it if you set fdm=syntax

I use fdm=indent.  That works great for me in most languages as long as
it's indented well. 

This is what I use
set fdl=90000
set fdm=indent
set fml=2

" Toggle fold state between closed and opened.
"
" If there is no fold at current line, just moves forward.
" If it is present, reverse it's state.
fun! ToggleFold()
        if foldlevel('.') == 0
                normal! l
        else
                if foldclosed('.') < 0
                        . foldclose
                else
                        . foldopen
                endif
        endif
        " Clear status line
        echo
endfun

" Map this function to Space key.
noremap <space> :call ToggleFold()<CR>

this also makes it easy to open and close foldings with space.

/Erik 
-- 
Erik BéČfors               | erik / bagfors.nu
Supporter of free software | GSM +46 733 279 273
fingerprint: 6666 A85B 95D3 D26B 296B 6C60 4F32 2C0B 693D 6E32