Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

syntax distinctions

18 views
Skip to first unread message

rj

unread,
Apr 7, 2013, 10:54:09 PM4/7/13
to
I have this line set in .vimrc:

hi LineNr ctermfg=darkblue

. . . because I want the line numbers in the left column of the vim buffer
to be darkblue.

But what is also dark blue is the "Subject:" line of in headers of mail and
news messages. (mailer: mutt, newsreader: slrn).

The subject line takes on whatever color I set LineNr to. How can I give
the subject line its own color?


--
Why you should never talk to cops: <http://is.gd/iV74U>

rj

unread,
Apr 7, 2013, 10:56:10 PM4/7/13
to

rj

unread,
Apr 8, 2013, 12:46:49 AM4/8/13
to
I have this line set in .vimrc:

hi LineNr ctermfg=darkblue

. . . because I want the line numbers in the left column of the vim buffer
to be darkblue.

But what is also dark blue is the "Subject:" line of in headers of mail and
news messages when I'm editing these messages in vim. (mailer: mutt,

rj

unread,
Apr 8, 2013, 12:48:17 AM4/8/13
to
I have this line set in .vimrc:

hi LineNr ctermfg=darkblue

. . . because I want the line numbers in the left column of the vim buffer
to be darkblue.

But what's also dark blue is the "Subject:" line in headers of mail and
news messages when I'm editing these messages in vim. (my mailer is mutt,
my newsreader is slrn).

rj

unread,
Apr 8, 2013, 1:29:59 AM4/8/13
to
I have this line set in .vimrc:

hi LineNr ctermfg=darkblue

. . . because (obviously) I want the line numbers in the left column of the
vim buffer to be dark blue.

But what's also dark blue is the "Subject:" line in headers of (mutt) mail and
(slrm) news messages when I'm editing these messages in vim.

rj

unread,
Apr 8, 2013, 5:47:24 PM4/8/13
to
I have this line set in .vimrc:

hi LineNr ctermfg=darkblue

. . . because (obviously) I want the line numbers in the left column of the
vim buffer to be dark blue.

But what's also dark blue is the "Subject:" line in headers of (mutt) mail and
(slrn) news messages when I'm editing these messages in vim.

Tony Mountifield

unread,
Apr 9, 2013, 4:38:38 AM4/9/13
to
In article <kjvdtc$a30$1...@reader1.panix.com>, rj <r...@panix.com> wrote:
> I have this line set in .vimrc:
>
> hi LineNr ctermfg=darkblue
>
> . . . because (obviously) I want the line numbers in the left column of the
> vim buffer to be dark blue.
>
> But what's also dark blue is the "Subject:" line in headers of (mutt) mail and
> (slrn) news messages when I'm editing these messages in vim.
>
> The subject line takes on whatever color I set LineNr to. How can I give
> the subject line its own color?

In the file /usr/share/vim/<version>/syntax/mail.vim, there is the line:

hi def link mailSubject LineNR

which is what assigns that same colour to mail subjects lines.

You could either edit that file (but your changes might get lost if you
upgrade vim), or you could add an override to your .vimrc

I'm not sure how you make sure an override gets executed after loading
the syntax file. Someone else here may be able to help with that.

Cheers
Tony
--
Tony Mountifield
Work: to...@softins.co.uk - http://www.softins.co.uk
Play: to...@mountifield.org - http://tony.mountifield.org

Christian Brabandt

unread,
Apr 9, 2013, 12:28:51 PM4/9/13
to
On 2013-04-09, Tony Mountifield <to...@mountifield.org> wrote:
> In the file /usr/share/vim/<version>/syntax/mail.vim, there is the line:
>
> hi def link mailSubject LineNR
>
> which is what assigns that same colour to mail subjects lines.
>
> You could either edit that file (but your changes might get lost if you
> upgrade vim), or you could add an override to your .vimrc
>
> I'm not sure how you make sure an override gets executed after loading
> the syntax file. Someone else here may be able to help with that.

Actually, it is enough to simply link mailSubject to a different
highlighting group, since hi def link will only link it, if there does
not exist a link yet.

See :h :hi-default


regards,
Christian

rj

unread,
Apr 9, 2013, 6:06:03 PM4/9/13
to
On Tue, 9 Apr 2013 08:38:38 +0000 (UTC), Tony Mountifield
<to...@mountifield.org> wrote:

> In the file /usr/share/vim/<version>/syntax/mail.vim,

Or in my case, /usr/local/libdata/vim/vim73/syntax/mail.vim

Since this file (and the mutt & slrn I'm using, and the vim I'm using to
edit/respond to mail & news messages) are all on a shell account, and not
my own machine, I can't write to the file.

So I simply put

hi mailSubject ctermfg=MyChosenColor

in my .vimrc, and this seems to have worked. I did have to see this line

> hi def link mailSubject LineNR

in the syntax file to know to set "mailSubject" in .vimrc. Thanks for both
responses.

rj

unread,
Apr 9, 2013, 9:50:50 PM4/9/13
to
On Tue, 9 Apr 2013 08:38:38 +0000 (UTC), Tony Mountifield
<to...@mountifield.org> wrote:

> In the file /usr/share/vim/<version>/syntax/mail.vim,

Or in my case, /usr/local/libdata/vim/vim73/syntax/mail.vim

Since this file is on a shell account, and not my own machine (and not part
of my user account on the shell box), I can't write to it. (The mutt
& slrn I'm using, and the vim I'm using to initiate, edit & respond to mail
& news messages, are also on the same shell account.)

So I simply put

hi mailSubject ctermfg=MyChosenColor

in my .vimrc, and this seems to have worked. I did have to see this line

> hi def link mailSubject LineNR

in the syntax file to know to set "mailSubject" in .vimrc. Thanks for both
responses.

Gary Johnson

unread,
Apr 26, 2013, 11:09:44 AM4/26/13
to
rj <r...@panix.com.invalid> wrote:
> I have this line set in .vimrc:
>
> hi LineNr ctermfg=darkblue
>
> . . . because I want the line numbers in the left column of the vim buffer
> to be darkblue.
>
> But what is also dark blue is the "Subject:" line of in headers of mail and
> news messages. (mailer: mutt, newsreader: slrn).
>
> The subject line takes on whatever color I set LineNr to. How can I give
> the subject line its own color?

It does that because of this line in $VIMRUNTIME/syntax/mail.vim:

hi def link mailSubject LineNR

You can override that by putting a line like this in a file named
~/.vim/after/syntax/mail.vim:

hi! link mailSubject Statement

Gary
0 new messages