Folding with VIM - Chirag Patel Dec 14, 2008
– Edit “~/.vimrc”
– Add following options
set fmr={,}
set fdm=indent
– To use syntax folding for a file, enter following command after opening it.
:set fdm=syntax
– To set no folding, edit “~/.vimrc”
set nofoldenable
– By default all available folds are folded. Change that to preferred max in “~/.vimrc”.
set fdn=1
1 is good value as it will close all top level folds to be closed (e.g. functions), but not any blocks inside.
– Some commands while in command in command mode:
zo ==> open fold under cursor
zO ==> open folds recursively under cursor
zc ==> close fold under cursor
zC ==> close folds recursively under cursor
zA ==> toggle folds recursively
zM ==> close all folds in a file
zR ==> open all folds in a file
Posted under Infrastructure, Linux
This post was written by Chirag on December 15, 2008
