CursorLine and NonText / SpecialKey highlight conflict

C :set cursorline and :set list characters in NonText and SpecialKey selection groups (for example, $ at the end of each line and ^M created by Ctrl + V Enter ) lose their selection when the cursor is on the same line, returning to the Normal selection group, as and any other soft text. It is very confusing and ugly and bad.

These are the relevant highlights in my configuration:

 :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 regardless of my backlight configuration (including without configuration). I know that some selection groups have always simply surpassed others, but syntax highlighting and selection from other groups ( Conceal , for example) remains intact; is there any way to make NonText and SpecialKey keep the selection?

+4
source share
2 answers

As far as I know, no. Bram Moolenaar said the following on this issue:

There is no decision. [...] Highlighting the cursor highlight should cancel the syntax highlighting, otherwise it will disappear in several situations, especially. if syntax highlighting uses background highlighting.

+2
source

If you want to select only the line number in which the cursor is located, you can use

 hi CursorLineNr term=underline cterm=none ctermfg=none ctermbg=235 hi CursorLine term=NONE cterm=NONE 

(vim8)

0
source

All Articles