Wednesday, March 6, 2013

Vim folding, auto fold xml, fold, unfold


To allow folds based on syntax add something like the following to your .vimrc:
set foldmethod=syntax
set foldlevelstart=1

let javaScript_fold=1         " JavaScript
let perl_fold=1               " Perl
let php_folding=1             " PHP
let r_syntax_folding=1        " R
let ruby_fold=1               " Ruby
let sh_fold_enabled=1         " sh
let vimsyn_folding='af'       " Vim script
let xml_syntax_folding=1      " XML

zo -- To open a fold block
zc -- To fold a block
zr -- Fold less
zm -- Fold more

2 comments:

  1. Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. auto response text

    ReplyDelete