> Hi, everyone. > I use fdm=marker. The problem is when you add a fold, the fold > after it will automatically open.
> 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
> -- > You received this message from the "vim_use" maillist. > Do not top-post! Type your reply below the text you are replying to. > For more information, visit http://www.vim.org/maillist.php
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)
On Sunday, April 15, 2012 2:32:09 AM UTC-5, Yichao Zhou wrote: > Hi, everyone. > I use fdm=marker. The problem is when you add a fold, the fold > after it will automatically open.
> 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
If you usually add open/close folds in the same insert operation, this will help:
On Sunday, April 15, 2012 2:32:09 AM UTC-5, Yichao Zhou wrote: > Hi, everyone. > I use fdm=marker. The problem is when you add a fold, the fold > after it will automatically open.
> 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?
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.