I want the cursor line number to have a different color than the rest of numbers when
cursorline is disabled.
CursorLineNR is only active when
set cursorline is set. I could do
set cursorline followed by
hi clear CursorLine with
hi CursorLineNR, however I want
cursorline to be visible when sit is set and not visible when it is not set, and still have the cursor line number have a different color.
set cursorline +
hi CursorLineNr guifg=#af00af, the line number
197 is purple:
But when followed by
set nocursorline the number
197 is gray as rest of numbers like below.
I want the
197 number to always be purple
guifg=#af00af, even after
set nocursorline. Is this anyhow possible?
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'
versus the same command line, but change
nocursorline on last argument to
cursorline and compare. The above command when run with
neovim makes the number line in red in both cases.