The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Usable Ruby folding for Vim

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Eigen Class

Posts: 358
Nickname: eigenclass
Registered: Oct, 2005

Eigenclass is a hardcore Ruby blog.
Usable Ruby folding for Vim Posted: Nov 1, 2005 9:45 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Eigen Class.
Original Post: Usable Ruby folding for Vim
Feed Title: Eigenclass
Feed URL: http://feeds.feedburner.com/eigenclass
Feed Description: Ruby stuff --- trying to stay away from triviality.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Eigen Class
Latest Posts From Eigenclass

Advertisement

The folding methods you get with a default vim install (even with updated Ruby support) are unsatisfying for a number of reasons:

  • fold_syntax and fold_indent create far too many folds (e.g. for syntactical elements like if or while). On top of that, they're nested, so you have to open folds recursively all the time. foldnestmax isn't an option because you never know how many class/module levels you're going to get: a value that works fine for code wrapped in a module would show too many folds in one consisting of bare (private Object) method definitions.
  • fold_marker requires too much work to mark all methods and classes
  • fold_expr could work but it would involve a fair deal of vimscript

As happens often with vim, spotting what I dislike is easier than finding right away what I want. I now know I want code folding in Ruby to work as follows:

  • no need for manual markers in general, but I want to have the option to use them.
  • folds for modules, classes, methods and constant definitions, and nothing else. I specifically want no intra-method folding (on if and such): if the method is large enough to warrant folds, you're screwed anyway.
  • no nested folds: I don't want to have to open a class fold to look at the folded methods.

To sum up, this is how I'd like folds to behave:


Read more...

Read: Usable Ruby folding for Vim

Topic: What to expect for C# 4.0 Previous Topic   Next Topic Topic: The Rightyear parsing library

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use