Re:Vim anti-patterns
by Jach on Tuesday February 07, 2012 @05:15PM
(#3563884)
Other "z" commands (these are the ones I always get mixed up):
[ Parent
| on HN ]
Some simple mnemonics might help you out.
zg g = Good word, add to personal dict
zug Undo Good word.
zw obviously, Wrong word.
...
zo Open
zA open All
zc Close
zj uses the same movement as the j key
zk ditto
Once you have the mnemonics sorted, sometimes you find you can remember the others because they are the ones "left out" of those with mnemonics, like zd doesn't have a mnemonic, so the command left over is "forget fold", so zd is that one. After a while, muscle memory takes over.Yeah, I like the fold commands, which I barley discovered a few weeks ago. I typically do "set foldmethod=indent" then pres "zr" multiple times until I'm at the fold level I want. Then I can just do "zo" on the parts of code I'm interested in.
Re:Vim anti-patterns
by jamesrcole on Wednesday February 08, 2012 @05:47AM
(#3566037)
there's also
zR - Open all folds
zM - Close all folds
zO - Open all folds under the cursor recursively
zC - Close all folds under the cursor recursively
zX - Undo manually opened and closed folds: re-apply 'foldlevel'.