Tuesday, February 2, 2021

Re: Highlight email headers with different colors

Definitely this is the way to go. I did try a few things as you suggested, without success.
This requires some more time to understand the file syntax. But I do not have enough time, nor the expertise to 
properly understand the syntax of the file (which seems very condensed). 
I was expecting anyone has already a solution and willing to share.

Thanks for the suggestions anayway.
On Tuesday, February 2, 2021 at 1:16:35 PM UTC-5 Charles Campbell wrote:
Ian N wrote:
> Thank you Christian!
> This is exactly what I have already done.
>
> Indeed, the mail.vim file highlights all the mail headers, with the
> same color (white in this case).
>
> My question is about how to customize these colors (when writing the
> mail) - say From: field blue, To: field red, ...
> I am trying to understand the mail.vim file. It seems it defines the
> mail header fields all together and colors them with one color.
>
> I am looking for a way to customize the mail header fields
> colors individually.
> Ian
>
You'll need to make a customized syntax/email.vim file. I suggest going
about this one field at a time.

Copy your system's email.vim into $HOME/.vim/syntax/email.vim.
Work with the copy:

Example:
    modify: syn region mailHeader ... remove "|from" from its start pattern
    new syntax: syn region mailHeaderFrom
    new highlighting: hi def mailHeaderFrom (whatever start= cterm=
gui= stuff you want)
    quoted regions: include mailHeaderFrom in mailQuoted[1-6]

Rinse and repeat for whatever fields you want to modify the highlighting
for.

Your version of email.vim will then override the system version, which
you should NOT modify. Future updates to vim could easily wipe your
modified email.vim away should you happen to modify the system version
in place.

Chip Campbell

--
--
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 http://www.vim.org/maillist.php

---
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/35c92a2d-10c5-46c3-bcee-2f4302117443n%40googlegroups.com.

No comments: