Open all folds
zi
Close all folds
zM
vimrc for folds
"folding method
"set foldmethod=indent
set foldmethod=syntax
"set fold color
hi Folded ctermfg=darkgrey
"indent folds to same has children
set foldtext=MyFoldText()
function! MyFoldText()
let n = v:foldend - v:foldstart + 1
let i = indent(v:foldstart)
let istr = ''
while i > 0
let istr = istr . ' '
let i = i - 1
endwhile
return istr . "+-" . v:folddashes . " " . n . " lines "
endfunction
"use F9 to open/close folds
inoremap za
nnoremap za
onoremap za
vnoremap zf
"auto save and auto load folds
autocmd BufWinLeave *.* mkview
autocmd BufWinEnter *.* silent loadview