[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

rdoc and vim folding

Ara.T.Howard

11/8/2004 10:34:00 PM

23 Answers

Dave Thomas

11/8/2004 11:15:00 PM

0


On Nov 8, 2004, at 16:43, Ara.T.Howard wrote:
> this wreaks havoc on rdoc output, especially when one has
>
> class Foo
> #{{{
> def bar
> end
> #}}}
> end

does this work?

class Fo0
#{{{

# Method comment for bar
def bar
end
#}}}
end

If no, I guess I could add code to ignore them--do many folks use this
feature of vim?


Cheers

Dave



Ara.T.Howard

11/9/2004 12:04:00 AM

0

Hans Fugal

11/9/2004 12:18:00 AM

0

Dave Thomas wrote:
>
> On Nov 8, 2004, at 16:43, Ara.T.Howard wrote:
>
>> this wreaks havoc on rdoc output, especially when one has
>>
>> class Foo
>> #{{{
>> def bar
>> end
>> #}}}
>> end
>
>
> does this work?
>
> class Fo0
> #{{{
>
> # Method comment for bar
> def bar
> end
> #}}}
> end
>
> If no, I guess I could add code to ignore them--do many folks use this
> feature of vim?
>
>
> Cheers
>
> Dave
>
>
>

I haven't had cause to use markers to do folding in ruby much, but I do
use the feature. I can't remember at the moment whether
foldmethod=syntax or foldmethod=indent works well for ruby code.

Ara.T.Howard

11/9/2004 12:21:00 AM

0

Ara.T.Howard

11/9/2004 12:38:00 AM

0

Gavin Sinclair

11/9/2004 1:15:00 AM

0

On Tuesday, November 9, 2004, 11:43:33 AM, Ara.T.Howard wrote:

> On Mon, 8 Nov 2004, Hans Fugal wrote:

>> I haven't had cause to use markers to do folding in ruby much, but I do use
>> the feature. I can't remember at the moment whether foldmethod=syntax or
>> foldmethod=indent works well for ruby code.

> IMHO - neither. too many folds. i like to fold class bodies, module bodies,
> and function bodies - and that's all. either way above does a LOT more.

Isn't there a way to limit the number of folds created by
fm=indent?

I would like to use Vim's folding, but there doesn't seem to be a way
to have it just Do The Right Thing. I certainly don't want explicit
fold markers in the code.

Cheers,
Gavin




Ara.T.Howard

11/9/2004 1:37:00 AM

0

Gavin Sinclair

11/9/2004 1:47:00 AM

0

On Tuesday, November 9, 2004, 12:43:34 PM, Ara wrote:

> On Tue, 9 Nov 2004, Gavin Sinclair wrote:

>> Isn't there a way to limit the number of folds created by
>> fm=indent?

> yes - but you can say do THIS and THAT level. just a depth

Maybe the fm=syntax option, then? I don't know anything about that,
but it sounds promising.

Gavin




Gavin Sinclair

11/9/2004 1:58:00 AM

0

On Tuesday, November 9, 2004, 12:47:07 PM, Gavin wrote:

> On Tuesday, November 9, 2004, 12:43:34 PM, Ara wrote:

>> On Tue, 9 Nov 2004, Gavin Sinclair wrote:

>>> Isn't there a way to limit the number of folds created by
>>> fm=indent?

>> yes - but you can say do THIS and THAT level. just a depth

> Maybe the fm=syntax option, then? I don't know anything about that,
> but it sounds promising.

Follow-up: it's not promising. Vim's current syntax definition for
Ruby (http://vim-ruby.rub...) does enable syntax-based folding,
but it can't be selective about what it folds (i.e. classes and
methods only, per Ara's request).

The following settings should be OK:

set foldmethod=syntax
set foldnestmax=2 " or 3

If anyone knows enough about Vim to make the folding smarter for Ruby
files, please step forward :)

Gavin





Eric Hodel

11/9/2004 2:32:00 AM

0

On Nov 8, 2004, at 5:58 PM, Gavin Sinclair wrote:

> On Tuesday, November 9, 2004, 12:47:07 PM, Gavin wrote:
>
>> On Tuesday, November 9, 2004, 12:43:34 PM, Ara wrote:
>
>>> On Tue, 9 Nov 2004, Gavin Sinclair wrote:
>
>>>> Isn't there a way to limit the number of folds created by
>>>> fm=indent?
>
>>> yes - but you can say do THIS and THAT level. just a depth
>
>> Maybe the fm=syntax option, then? I don't know anything about that,
>> but it sounds promising.
>
> Follow-up: it's not promising. Vim's current syntax definition for
> Ruby (http://vim-ruby.rub...) does enable syntax-based folding,
> but it can't be selective about what it folds (i.e. classes and
> methods only, per Ara's request).
>
> The following settings should be OK:
>
> set foldmethod=syntax
> set foldnestmax=2 " or 3
>
> If anyone knows enough about Vim to make the folding smarter for Ruby
> files, please step forward :)

If you want to not fold on a particular syntax construct, you need only
remove the 'fold' from the end of the 'syn region'.

:help syn-region should help you out.