1

I use the a formatoption to make my text hard wrap, and the n formatoption to recognize numbered lists. The help says that the n option should use the formatlistpat regex to determine which lines not to mess with, but it doesn't seem to be working for me; vim is joining all my bulleted lines.

These are the values of my options:

formatoptions=tqlran
textwidth=65
formatlistpat=^\s*\d\+\.\s\+\|^[-*+]\s\+\|^\[^\ze[^\]]\+\]:
filetype=markdown

Also, formatlistpat was "Last set from usr/local/Cellar/vim/8.0.1650_1/share/vim/vim80/ftplugin/markdown.vim", so I know it's not just a matter of me not escaping the regex correctly when setting it.

An example of the bad behavior can be seen in this video.

Any idea how I can make vim stop joining lines like this?

  • What's the output of :verbose set comments? Does the command :set comments& fix the issue? – Rich Jun 1 '18 at 22:18
  • And how about :set comments+=fb:- ? – Rich Jun 1 '18 at 22:24
  • Hi @Rich, thanks so much for your response! I wasn't aware of the comments functionality and reading the help for it has helped me a ton and fixed the joining problem. However, I'm still having a strange issue where new lines get an increased level of indentation, and I can't figure out why, since the help pages say the 'f' option for comments "preserves indentation". Would you happen to have any idea what could be going on here? I made a short video to show the behavior and my settings: asciinema.org/a/nd8icEv0Bkaphkhvf7qKAyqiq . Thanks again! – Christopher Shroba Jun 5 '18 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.