3

When I add m to formatoptions and have nonzero textwidth, Vim will insert line breaks after commas followed by tildes when I do gq in Normal mode. In my case, Vim sometimes inserts a line break at the comma in lines like

... \dots,~$A$

converting it to

... \dots,
~$A$

when I would prefer to keep it whole, that is,

...
\dots,~$A$

instead. According to :help fo-table

letter   meaning when present in 'formatoptions'
...
m   Also break at a multibyte character above 255.  This is useful for
    Asian text where every character is a word on its own.

So this seems strange to me, since I thought both , and ~ are part of ASCII. Is there a way to prevent this behavior other than removing m?

1
  • Apparently, it is the comma that is causing the line break with formatoptions=m. Maybe you should file a bug report.
    – r_31415
    Jun 15, 2022 at 18:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.