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.

3 Likes

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

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

augroup specific_fold_methods
  autocmd!
...
  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 http://vim.wikia.com/wiki/Syntax_folding_of_Vim_scripts ?

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