Pair program with me! profile for carousel at Stack Overflow, Q&A for professional and enthusiast programmers

3/10/2013

the power of vim folding

Code folding is very powerful technique, which is not so obvious. But when you see how folding can help you organize your code ( especially long nestings ) you'll start using immediately.

Of course, vim has a great support for folding.

Here are some commands ( in normal mode)
zf - create folding ( after selecting in visual mode)
za - toggle foldings
zc - fold close
zo - fold open
zE - remove all folding 
Here are some screencasts of folding a long function ( 100 lines of code ). To see a flow of folding, select an image, and then blogger will open nice gallery. After that just scroll througn images with middle mouse wheel.













































Happy Coding

No comments:

Post a Comment