Hi all,
The following folding patterns for javascript will:
1. fold any line that contains a function, such as: - object literal style function declarations (ala rails prototype) - lambdas that you pass to your js implementations of map, select and inject 2. not think single-line functions mark a fold start
foldingStartMarker = '^.*\bfunction\s*(\w+\s*)?([^)]*)(\s*{[^}]*)?\s*$'; foldingStopMarker = '^\s*}';
Hope you find it useful.
I tested it against a dozen or so js files of varied convolutedness and was quite satisfied, but if you find something wonky let me know.