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,randoare removed fromformatoptionsso the comment leader is not auto-inserted after pressingenternoro. - Other effects of setting
commentsseem to be subsumed by theformatlistpatsettings in conjunction with the otherformatoptionsflags.
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 [-\\*+]?