4 comments

[ 5.9 ms ] story [ 12.4 ms ] thread
This is a really useful article.

Though I've found it's easier to open folds by moving the cursor, e.g. right-arrow while on a fold line, than futzing with "zo".

You should never ever touch an arrow key when using Vim. If you are using hjkl for movement, hit 'l' to open a fold.
I've got `zo` remapped to space. Or, more precisely:

nmap <space> za vmap <space> zf

Neat. I'm addicted to vim partly because of its great and very flexible folds. For example, you can completely rewrite the way folds look. I like my folded code to look like its first line would normally look, without any dashes, preserving indentation. So I just rewrote the function (here's a blog post about it: http://a-dimit.blogspot.com/2008/07/folding-in-vim.html)

It really rocks :-)