Syntax-highlighting last character in a line

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Syntax-highlighting last character in a line

martin f krafft-2

I am trying to transition to format=flowed for e-mails, which is
harder than it should be. I'd like to enlist vim to help me.

What I would like to achieve is to highlight any final characters of
a line that aren't spaces, i.e. /\S$/, unless the line is followed
by an empty line. The idea is that I I'll be visually alerted to
lines in paragraphs that don't fit the format=flowed structure.

Using "match Error /\S$/" works, but that also covers quotes,
signature, and header, where format=flowed doesn't really apply. And
it highlights the final character of the last line of a paragraph,
which it shouldn't.

I'd like to restrict the matching to just the plain text in the mail
body, more specifically to all but the last line of a paragraph
(where paragraphs are separated by an empty line).

This sounds like syntax highlighting to me.

Syntax highlighting for mails in Vim already knows when I am in the
plain text (synID == 0). How can I leverage this knowledge and add
a new syntax highlighting?

At this stage, I cannot even get any result out of

  syn match       mailBodyTrailingNonspace "/\S$"

and I would appreciate if anyone could provide me with any clues.

Thank you!

@martinkrafft | <a href="">
"the truth is rarely pure and never simple. modern life would be very
 tedious if it were either, and modern literature a complete
                                                      -- oscar wilde
spamtraps: [hidden email]

You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit

You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit

digital_signature_gpg.asc (1K) Download Attachment