vim-markdown
vim-markdown copied to clipboard
comments vs formatlistpat
This is more of a question than a report: I can't figure out the point of the following sequence:
setlocal comments=fb:*,fb:-,fb:+,n:>
...
setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o
...
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]:
My confusion is due to:
- After setting
comments
,r
ando
are removed fromformatoptions
so the comment leader is not auto-inserted after pressingenter
noro
. - Other effects of setting
comments
seem to be subsumed by theformatlistpat
settings in conjunction with the otherformatoptions
flags.
Could you clarify this? Thanks!
From what I observed, the fact that [-*+]
in 'formatlistpat'
is missing space in front is causing 'formatoptions'
n
to not work on indented unordered lists such as nested lists.
Due to that, the fb:*,fb:-,fb:+
in 'comments'
seems to have been added to serve as a workaround for the formatting issue with indented unordered lists.
To put it another way, modifying the lines as shown below seems to works fine and makes more sense to me.
setlocal comments=n:>
...
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]:
should it not be [-\\*+]
?