Assuming the syntax file has a good indentation for the java script, visually highlight the block and press =. This works for Java, so I expect it to do something half decent for a java script. The results probably also depend on the settings for tabstop, expandtab, and possibly shiftwidth.
gq is also useful, it formats strings, not padding them.
Peter Mar 08 '09 at 14:38 2009-03-08 14:38
source share