Code folding with vim/nvim

Vim / Nvim users, how do enable code folding (zc/zo) in OCaml files ?

I tend to just use foldmethod=indent.


thanks, @c-cube, it works fine for the principal functions.

function ConfigureOCamlFoldMethods()
setlocal foldmethod=indent
setlocal foldlevel=0 "all folded at start

augroup specific_fold_methods
  autocmd FileType ocaml :call ConfigureOCamlFoldMethods()
augroup END

I set as solved, but just to be sure do you know any custom (full or not finished) nvim/vim configurations that uses foldmethod=syntax like this ?

No, I don’t know of any syntax directed fold method.