Saturday, December 31, 2011

folding ruby comments

in ruby a line that start with # (can have spaces before) is a
comment.
I want to be able to toggle between fold all comments and unfold them.
It will also be nice to apply this rule only on 3 consecutive lines
(or more).
Here is what I came up so far:

set foldmethod=expr
set foldexpr=getline(v:lnum)=~'\s*#'

the problem is it's folding 2 lines whenever there is only 1 comment.

def self.perform(picture_id)
#do something that takes time
puts "doing some job. picture id #{picture_id}"
sleep(5)
puts "done!!!"
end

any help would be great. thanks!

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment