With :set cursorline
and :set list
, the characters in the NonText
and SpecialKey
highlight groups (for example, $
at the end of each line, and ^M
produced by Ctrl+VEnter) lose their highlighting when the cursor is on the same line, reverting to the Normal
highlight group like any other bland text. This is very confusing and ugly and bad.
These are the relevant highlights in my config:
:hi Conceal term=reverse cterm=none ctermfg=237 ctermbg=none
:hi CursorLine term=underline cterm=none ctermfg=none ctermbg=235
:hi NonText term=reverse cterm=none ctermfg=237 ctermbg=none
:hi Normal term=none cterm=none ctermfg=252 ctermbg=234
:hi SpecialKey term=reverse cterm=none ctermfg=14 ctermbg=23
The problem persists no matter my highlight configuration (including no configuration at all). I know that some highlight groups just always trump others, but syntax highlighting and highlighting from other groups (Conceal
, for example) remains intact; is there a way to make NonText
and SpecialKey
retain their highlight?
As far as I'm aware, no. Bram Moolenaar has said the following on this matter:
There is no solution. [...] The cursorline highlighting needs to overrule the syntax highlighting, otherwise it would disappear in several situations, esp. if the syntax highlighting uses background highlighting.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With