vim 6.1->6.3 mail.vim colours

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

vim 6.1->6.3 mail.vim colours

Troy Piggins-2
I only just upgraded my vim from RH9 rpm version 6.1 to one I
compiled from source (6.3).  So far all seems to be working as per
the rpm version I had (other than having to enter "syntax on" in my
~/.vimrc - RH must have that already on in a system-wide vimrc).

One thing I have noticed is the actual colours used when composing
emails.  I understand /usr/local/share/vim/vim63/syntax/mail.vim is
used.  In the 6.3 default one, quoted text appears cyan, email
addresses red, web urls magenta etc.

Call me pedantic, but I liked what I assume were RH's mail.vim
colours with email addresses _and_ web urls blue, and quotes green
(maybe they were always cyan, not sure?). This is what my mutt pager
displays them as also.

I'd also like to have _underlines_, /italics/, and *bold* words
recognised and coloured cyan, yellow, and white respectively similar
to my pagers in mutt and slrn.

I had a look in the actual mail.vim file, and there didn't appear to
be any references to colours at all in there. So where do I change
those settings?  How do I achieve the above?

--
Troy Piggins
Compiled from src: vim 6.3; mutt 1.5.9i; postfix 2.2.4;
                   slrn 0.9.8.1/rt (score_color patch)
RedHat 9 rpms    : kernel 2.4.20-31.9; procmail 3.22
Reply | Threaded
Open this post in threaded view
|

Re: vim 6.1->6.3 mail.vim colours

Peter Hodge-2
> One thing I have noticed is the actual colours used when composing
> emails.  I understand /usr/local/share/vim/vim63/syntax/mail.vim is
> used.  In the 6.3 default one, quoted text appears cyan, email
> addresses red, web urls magenta etc.
>
> Call me pedantic, but I liked what I assume were RH's mail.vim
> colours with email addresses _and_ web urls blue, and quotes green
> (maybe they were always cyan, not sure?). This is what my mutt pager
> displays them as also.

Try changing the color scheme using:
    :colorscheme default
    :colorscheme elflord
    :colorscheme morning
etc.  The complete list of colorschemes can be found in
vim63/colors/

If you start up your old RHVim and type
    :echo colors_name
you can see what colorscheme was used.


regards,
Peter


               
____________________________________________________
Do you Yahoo!?
Find a local business fast with Yahoo! Local Search
http://au.local.yahoo.com
Reply | Threaded
Open this post in threaded view
|

Re: vim 6.1->6.3 mail.vim colours

Troy Piggins-2
* [hidden email] <[hidden email]> :

> > One thing I have noticed is the actual colours used when
> > composing emails.  I understand
> > /usr/local/share/vim/vim63/syntax/mail.vim is used.  In the 6.3
> > default one, quoted text appears cyan, email addresses red, web
> > urls magenta etc.
> >
> > Call me pedantic, but I liked what I assume were RH's mail.vim
> > colours with email addresses _and_ web urls blue, and quotes
> > green (maybe they were always cyan, not sure?). This is what my
> > mutt pager displays them as also.
>
> Try changing the color scheme using:
>     :colorscheme default
>     :colorscheme elflord
>     :colorscheme morning
> etc.  The complete list of colorschemes can be found in
> vim63/colors/

Tried that, and the default scheme works ok for me out of that bunch
- I did like "evening" and "ron" though.  None were exactly what I
  want.

> If you start up your old RHVim and type
>     :echo colors_name
> you can see what colorscheme was used.

Tried that too, and it appeared to be none specified (ie getting
undefined variable error message).

I think I might play with setting up my own from scratch.  Time to
learn something new.

Thanks for your input, though.

--
Troy Piggins
Compiled from src: vim 6.3; mutt 1.5.9i; postfix 2.2.4;
                   slrn 0.9.8.1/rt (score_color patch)
RedHat 9 rpms    : kernel 2.4.20-31.9; procmail 3.22
Reply | Threaded
Open this post in threaded view
|

Re: vim 6.1->6.3 mail.vim colours

Chris Allen
On 07/10/05, Troy Piggins <[hidden email]> wrote:
> I think I might play with setting up my own from scratch.  Time to
> learn something new.

No need to go to all that effort.  Mail.vim will not have mentioned
colours secifically because it does not choose them.  You will find in
the file a lot of statements along the lines of hi def link
mailSomething SomethingElse and those are the lines that control
colour, to an extent.  They just link one highlighting group to an
existing one, and the colours for that are used.

If you wish to set your own colours then you can change them with the
:highlight command.  The :highlight command on its own will list all
the highlighting groups you have and show an example.  You probably
want to have a look at that.  Once you've decided what you don't like
you can change it with statements along the lines of:

    highlight mailQuoted1 cterm=reverse ctermfg=orange ctermbg=red

places in your .vimrc.  Or you could change the Comment colouring,
which is blue by default, and what mailQuoted1 is linked to.

See also :help :highlight

HTH,
Chris Allen
Reply | Threaded
Open this post in threaded view
|

Re: vim 6.1->6.3 mail.vim colours

A.J.Mechelynck
In reply to this post by Troy Piggins-2
Troy Piggins wrote:

> * [hidden email] <[hidden email]> :
>>> One thing I have noticed is the actual colours used when
>>> composing emails.  I understand
>>> /usr/local/share/vim/vim63/syntax/mail.vim is used.  In the 6.3
>>> default one, quoted text appears cyan, email addresses red, web
>>> urls magenta etc.
>>>
>>> Call me pedantic, but I liked what I assume were RH's mail.vim
>>> colours with email addresses _and_ web urls blue, and quotes
>>> green (maybe they were always cyan, not sure?). This is what my
>>> mutt pager displays them as also.
>> Try changing the color scheme using:
>>     :colorscheme default
>>     :colorscheme elflord
>>     :colorscheme morning
>> etc.  The complete list of colorschemes can be found in
>> vim63/colors/
>
> Tried that, and the default scheme works ok for me out of that bunch
> - I did like "evening" and "ron" though.  None were exactly what I
>   want.
>
>> If you start up your old RHVim and type
>>     :echo colors_name
>> you can see what colorscheme was used.
>
> Tried that too, and it appeared to be none specified (ie getting
> undefined variable error message).
>
> I think I might play with setting up my own from scratch.  Time to
> learn something new.
>
> Thanks for your input, though.
>
Try setting up your own colorscheme.

At the end of $VIMRUNTIME/syntax/mail.vim, starting (in release 6.3) at
line 71, you see a number of ":hi" statements defining the "mail"
highlight groups. These are the names (mailHeader, mailHeaderKey, etc.)
to which you may want to associate colors. By default they reuse colors
for other highlight groups (Statement, Type, etc.) defined elsewhere but
you can change that. See ":help :hi" about how to do it.

I don't use Vim for mail myself but I do use a very simple homemade
colorscheme, which I am appending to this email as an example of what is
the necessary minimum (statements other than ":hi[ghlight]") and as a
source of inspiration for you.

Give your colorscheme any name ending in .vim and place it in one of
~/.vim/colors/ (user-private, on Unix), ~/vimfiles/colors/
(user-private, on Windows) or $VIM/vimfiles/colors/ (system-wide, on
both Unix and Windows). In general, use the colors/ subdirectory of some
directory named before $VIMRUNTIME in the 'runtimepath' option. (Don't
touch $VIMRUNTIME itself, nor its subdirectories: they contain the
runtime files distributed with Vim; any upgrade may silently replace
anything there, and the next version upgrade, such as the upcoming 6.4,
will recreate the whole $VIMRUNTIME tree from scratch under a different
name, in this case ending in .../vim64/ instead of .../vim63/ .)

Finally, invoke your colorscheme with the :colorscheme statement, from
the Vim command-line while testing, and, once you're satisfied with it,
from your vimrc.


Best regards,
Tony.

hi clear Normal
set bg&
hi clear

if exists("syntax_on")
        syntax reset
endif

let colors_name = "almost-default"

" start non-default highlight settings
" hi clear Error
hi StatusLine gui=NONE,bold guibg=red guifg=white
hi Visual gui=NONE guibg=#E0E0E0 guifg=NONE
hi Error guibg=#FF3333 guifg=Black
hi clear ErrorMsg
hi link ErrorMsg Error
hi Search guifg=Black
if &bg == "dark"
 hi Comment ctermfg=cyan
 hi Statement ctermfg=yellow
 hi Constant ctermfg=magenta
 hi Identifier ctermfg=green
endif
" hi IncSearch gui=NONE guibg=#999999
" end highlight settings
Reply | Threaded
Open this post in threaded view
|

Re: vim 6.1->6.3 mail.vim colours

Gary Johnson
In reply to this post by Troy Piggins-2
On 2005-10-07, Troy Piggins <[hidden email]> wrote:

> * [hidden email] <[hidden email]> :
> > > One thing I have noticed is the actual colours used when
> > > composing emails.  I understand
> > > /usr/local/share/vim/vim63/syntax/mail.vim is used.  In the 6.3
> > > default one, quoted text appears cyan, email addresses red, web
> > > urls magenta etc.
> > >
> > > Call me pedantic, but I liked what I assume were RH's mail.vim
> > > colours with email addresses _and_ web urls blue, and quotes
> > > green (maybe they were always cyan, not sure?). This is what my
> > > mutt pager displays them as also.

> > If you start up your old RHVim and type
> >     :echo colors_name
> > you can see what colorscheme was used.
>
> Tried that too, and it appeared to be none specified (ie getting
> undefined variable error message).

Instead of ":echo colors_name" you could execute ":hi" which would
show you the definitions of all the color names including the mail*
colors.

I wanted to change the colors used by $VIMRUNTIME/syntax/mail.vim,
too, but without changing the colors used elsewhere, so I created a
new file, ~/.vim/after/syntax/mail.vim, and put lines like this in
it:

    highlight mailHeaderKey ctermfg=yellow cterm=NONE
    highlight mailHeader ctermfg=green cterm=NONE
    ...

HTH,
Gary

--
Gary Johnson                 | Agilent Technologies
[hidden email]     | Wireless Division
                             | Spokane, Washington, USA
Reply | Threaded
Open this post in threaded view
|

Re: vim 6.1->6.3 mail.vim colours

Troy Piggins-2
In reply to this post by A.J.Mechelynck
* A. J. Mechelynck <[hidden email]> :

> Troy Piggins wrote:
> > * [hidden email] <[hidden email]> :
> >>> One thing I have noticed is the actual colours used when
> >>> composing emails.  I understand
> >>> /usr/local/share/vim/vim63/syntax/mail.vim is used.  In the 6.3
> >>> default one, quoted text appears cyan, email addresses red, web
> >>> urls magenta etc.
> >>>
> >>> Call me pedantic, but I liked what I assume were RH's mail.vim
> >>> colours with email addresses _and_ web urls blue, and quotes
> >>> green (maybe they were always cyan, not sure?). This is what my
> >>> mutt pager displays them as also.
[snip]

> > I think I might play with setting up my own from scratch.  Time to
> > learn something new.
> >
> > Thanks for your input, though.
>
> Try setting up your own colorscheme.
>
> At the end of $VIMRUNTIME/syntax/mail.vim, starting (in release 6.3) at
> line 71, you see a number of ":hi" statements defining the "mail"
> highlight groups. These are the names (mailHeader, mailHeaderKey, etc.)
> to which you may want to associate colors. By default they reuse colors
> for other highlight groups (Statement, Type, etc.) defined elsewhere but
> you can change that. See ":help :hi" about how to do it.
>
> I don't use Vim for mail myself but I do use a very simple homemade
> colorscheme, which I am appending to this email as an example of what is
> the necessary minimum (statements other than ":hi[ghlight]") and as a
> source of inspiration for you.
>
> Give your colorscheme any name ending in .vim and place it in one of
> ~/.vim/colors/ (user-private, on Unix), ~/vimfiles/colors/
> (user-private, on Windows) or $VIM/vimfiles/colors/ (system-wide, on
> both Unix and Windows). In general, use the colors/ subdirectory of some
> directory named before $VIMRUNTIME in the 'runtimepath' option. (Don't
> touch $VIMRUNTIME itself, nor its subdirectories: they contain the
> runtime files distributed with Vim; any upgrade may silently replace
> anything there, and the next version upgrade, such as the upcoming 6.4,
> will recreate the whole $VIMRUNTIME tree from scratch under a different
> name, in this case ending in .../vim64/ instead of .../vim63/ .)
>
> Finally, invoke your colorscheme with the :colorscheme statement, from
> the Vim command-line while testing, and, once you're satisfied with it,
> from your vimrc.

Thanks for the detailed response and attachment, Tony.  Also thanks
to Chris and Gary for their similar responses.  I had, after my last
mail, found the :highlight command etc.  I will take your example
and have some fun with it ;-)

--
Troy Piggins
Compiled from src: vim 6.3; mutt 1.5.9i; postfix 2.2.4;
                   slrn 0.9.8.1/rt (score_color patch)
RedHat 9 rpms    : kernel 2.4.20-31.9; procmail 3.22