For example, type {{{<CR>}}}<ESC>zcggO{{{
You will find the second fold is opened automatically. This is
annoying when editing. Must I reclose all the folding when add a new
one?
Regards,
Yichao Zhou
Have you checked your 'foldlevel' setting?
regards,
Christian
The tip is to first put closing marker }}} and then the opening one {{{.
You can also use {{{1 (without adding closing marker, the next {{{1 serves as
opening and closing marker)
Best,
Marcin
If you usually add open/close folds in the same insert operation, this will help:
http://vim.wikia.com/wiki/Keep_folds_closed_while_inserting_text
If you need to move around a bunch in normal mode before adding the closing marker, it won't help as much.
I realized after I posted, you should also consider using zf to create fold markers rather than going into insert mode, which should prevent this problem altogether.
:help zf
Note that the 'commentstring' option is used to determine what text to place before the created fold markers.
:help fold-create-marker
:help 'commentstring'