For markdown files and the like, I have formatoptions
set to tln
and I am using a simplified version of formatlistpat
that looks for digits and a *
character. The indenting on a list works fine, the way I expect it to.
But, when I have a paragraph with numbers in it, where the auto-wrap causes the line to start with a numeric, it is acting like that line is a numbered list and indents the following line.
Example:
When you are writing code in Python
3.12, you need to ensure that you
are using the latest version.
This drives me crazy enough that I have a function to quickly turn formatting on and off. Is there a better way to detect what is and isn't a list? Some way to say if the list section doesn't have a blank leading line it isn't a list? A way of invoking Q} two different ways, with and without list formatting?
Any tips / configuration help would be greatly appreciated.
Q}
thing. Did you meangq}
?formatlistpat
and a small text just to verify that the solution proposed solves your problem.gq}
, I have annoremap
onQ
which I've had for so long I forget that everyone else doesn't. Not sure where I picked that up Current settings that may be relevant:autoindent
textwidth=78
formatoptions=tcql
filetype=ghmarkdown
formatlistpat=^\s*[0-9*]\+[\]:.)}\t ]\s*