A question about highlight-cterm

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

A question about highlight-cterm

Lifepillar-2
I am a bit puzzled by the note in `:help highlight-cterm`:

    Note: Many terminals (e.g., DOS console) can't mix these attributes with
    coloring. Use only one of "cterm=" OR "ctermfg=" OR "ctermbg=“.

Virtually all colorschemes I have seen use ctermfg AND ctermbg AND cterm.

The note above is also at odds with `:help cterm-colors`, which states:

    If you want to set the bold attribute in a different way, put a "cterm="
    argument AFTER the "ctermfg=" or "ctermbg=" argument.

Which implies that cterm and ctermfg/ctermbg can coexist.

Perhaps, the above note is a thing of the past and should be removed?

Thanks,
Life.


--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/BE5F4380-F18E-46C5-9E65-89DB249701EA%40icloud.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: A question about highlight-cterm

Tony Mechelynck
On Sat, May 11, 2019 at 12:04 PM 'Lifepillar' via vim_use
<[hidden email]> wrote:

>
> I am a bit puzzled by the note in `:help highlight-cterm`:
>
>     Note: Many terminals (e.g., DOS console) can't mix these attributes with
>     coloring. Use only one of "cterm=" OR "ctermfg=" OR "ctermbg=“.
>
> Virtually all colorschemes I have seen use ctermfg AND ctermbg AND cterm.
>
> The note above is also at odds with `:help cterm-colors`, which states:
>
>     If you want to set the bold attribute in a different way, put a "cterm="
>     argument AFTER the "ctermfg=" or "ctermbg=" argument.
>
> Which implies that cterm and ctermfg/ctermbg can coexist.
>
> Perhaps, the above note is a thing of the past and should be removed?
>
> Thanks,
> Life.

I believe that the confusion is due to the fact that (a) cterm=NONE;
(b) cterm=bold; (c) other values interact in three different ways
(when they do at all) with bg/fg color settings.

IIUC you can use cterm=NONE _before_ ctermbg= ctermfg= in order to
clear anything that may be present before (such as bold) but not your
own colours. It *may* be possible to add cterm=bold after a ctermfg=
color in the range 0..7; OTOH ctermfg= in the range 8..16 (on an
8-or-16-bg 16-fg terminal) usually _implies_ bold. Using both
cterm=underline and ctermfg= ctermbg= will usually not work as
expected. OTOH AFAIK ctermbg= and ctermfg= can usually be used
together provided that you don't exceed the terminal's capabilities.

Best regards,
Tony.

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXsmBFgZ3YUs36U3Qu5o4c34x2PQNZJZPVh7nm7DT3HEwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: A question about highlight-cterm

Bram Moolenaar
In reply to this post by Lifepillar-2

> I am a bit puzzled by the note in `:help highlight-cterm`:
>
>     Note: Many terminals (e.g., DOS console) can't mix these attributes with
>     coloring. Use only one of "cterm=" OR "ctermfg=" OR "ctermbg=“.
>
> Virtually all colorschemes I have seen use ctermfg AND ctermbg AND cterm.
>
> The note above is also at odds with `:help cterm-colors`, which states:
>
>     If you want to set the bold attribute in a different way, put a "cterm="
>     argument AFTER the "ctermfg=" or "ctermbg=" argument.
>
> Which implies that cterm and ctermfg/ctermbg can coexist.
>
> Perhaps, the above note is a thing of the past and should be removed?

It is not of the past, the basic ANSI terminal still only has 8 or 16
colors.  But most users would be using 256 colors whenever they can.
Let's rephrase this:

        Note: Some terminals (e.g., DOS console) can't mix these attributes
        with coloring. To be portable, use only one of "cterm=" OR "ctermfg="
        OR "ctermbg=".

--
This message contains 78% recycled characters.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/201905111110.x4BBA4Kk009445%40masaka.moolenaar.net.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: A question about highlight-cterm

Lifepillar-2
On 11 May 2019, at 13:10, Bram Moolenaar <[hidden email]> wrote:


I am a bit puzzled by the note in `:help highlight-cterm`:

   Note: Many terminals (e.g., DOS console) can't mix these attributes with
   coloring. Use only one of "cterm=" OR "ctermfg=" OR "ctermbg=“.

Virtually all colorschemes I have seen use ctermfg AND ctermbg AND cterm.

The note above is also at odds with `:help cterm-colors`, which states:

   If you want to set the bold attribute in a different way, put a "cterm="
   argument AFTER the "ctermfg=" or "ctermbg=" argument.

Which implies that cterm and ctermfg/ctermbg can coexist.

Perhaps, the above note is a thing of the past and should be removed?

It is not of the past, the basic ANSI terminal still only has 8 or 16
colors.

I have never encountered an issue using ctermfg and ctermbg (and cterm) in the
same definition, even with as few as eight colors, provided that the values are
in the 0-7 range. Perhaps it is because I am mostly working with xterm, or
I haven't looked hard enough. I am curious which terminals one might use in
Unix/Linux/macOS land to experiment with terminal emulators' weirdness.

Looking at the colorschemes distributed with Vim, it seems that the "xor rule"
of highlight-cterm is not honored. I guess that they are portable enough
nonetheless.

Anyway, thank you both for the feedback!
Life.

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/E6CEAA9C-25A9-427C-A190-D7499E81EB6B%40icloud.com.
For more options, visit https://groups.google.com/d/optout.