I want the cursor line number to have a different color than the rest of numbers with cursorline disabled.
Sadly CursorLineNR
is only active if set cursorline
. I could do set cursorline
followed by hi clear CursorLine
with hi CursorLineNR
, however I want cursorline to be visible when set and not visible when not set, and still have the cursor line number have a different color.
With set cursorline
+ hi CursorLineNr guifg=#af00af
:
but when doing set nocursorline
it disappears:
I want the 197
number to always be guifg=#af00af
, even after set nocursorline
. Is this anyhow possible?
Ie. compare:
vim -u NONE -c 'hi CursorLineNr guibg=#ff0000 ctermbg=red' -c 'set number relativenumber' -c 'exe "normal i\<cr>- should be red\<cr>\<up>\<esc>"' -c 'set nocursorline'
vs the same with cursorline
in the last argument (or do :set cursorline
). The same above command when run with neovim
makes the number line in red in both cases.
CursorLineNr Like LineNr when 'cursorline' is set and 'cursorlineopt' is set to "number" or "both", or 'relativenumber' is set, for the cursor line.
--should be used whenrnu
is set no matter what? Having said that, my vim does what yours does. Perhaps a bug? Or perhaps the wordings means ('cul') & ('cursorlineopt' | 'rnu') – D. Ben Knoble♦ Nov 11 '20 at 21:29