SO...
Sublime Text has the built in ability to fold methods, but as soon as the method declaration spans multiple lines it loses this ability. Does anyone know about a plugin or a way to make this work? Specifically I am running into this with ruby (and my team adheres to a strict style guide regarding line length), but the language shouldn't matter.
Instead of clicking on the down arrow that appears in the gutter next to the first line of the function definition, all you need to do is put your cursor on one of the function's indented lines (not the indented function parameters, but in the function definition itself) and use the CtrlShift[ key binding (on OS X use ⌘Alt[) to fold the function and its parameters. Use CtrlShift] (⌘Alt] on OS X) to unfold, or you can click the sideways arrow next to the def
line.
So, this:
becomes this:
Try this formatting
def example( # <--- folds parameters here
param,
param
) # <--- folds method body here
foo
bar
qux
end
The language does matter as far as I know, method folding is part of the language specific configuration. At least it used to be in previous versions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With