syntax highlight

Tuesday, 6 October 2009

Vim Tip: Folding FTW

I always say methods should have two levels of indentation at most, but even if your code is perfect like mine you may still have to dwell with other people's code (which, obviously, is ugly code), people how may have lots of fun shaping the program like a pyramid.

Not all is lost, you don't have to commit sepuku (at least not for this one). Just use Vim's indent method like this:

:set foldmethod=indent

That should give you a better view of the code flow. As always, use '%' to navigate all those pesky { and }.

No comments:

Post a Comment