Vim and Gvim - Change color for cursorline line numbers

6

I have downloaded and installed the blueshift colorscheme for vim/gvim.

This highlights the current line with cursorline, which is what I want, however the background color of the line numbers column is changed to "white".

  • How can I change this color?

I would like to change it to be a more subtle color, perhaps something close to #c0d0e0 which is the background color of the "non-current-line" line numbers.

To help illustrate my description, please see the attached image below.

Screenshot

The "red" is ok, but I would like to change the "white" background to another color.

user3728501

Posted 2018-01-11T17:36:57.917

Reputation: 1 090

Answers

6

This is controlled by the CursorLineNr highlight group. It's a recent (Vim 7.4) addition; the blueshift colorscheme does not have a definition for that.

You can change it like that (after the :colorscheme blueshift command):

:highlight CursorLineNr gui=bold guifg=DarkRed guibg=#c0d0e0

Ingo Karkat

Posted 2018-01-11T17:36:57.917

Reputation: 19 513

That's really cool. Thanks. How did you manage to find this information? I have a few more questions to ask but it would probably be better if I could just figure it out myself (assuming that you have a reference for this info). – user3728501 – 2018-01-12T12:17:12.037

2You can see all highlight groups via :hi. In the Vim help, this is documented at :help highlight-groups. I remembered this particular group name because I follow the Vim development quite closely. – Ingo Karkat – 2018-01-12T12:21:49.413