I use default colorscheme for Vim since I just love to have consistency throughout my terminal. One thing I don't love though is the colour of number lines, bright yellow doesn't suit it. Is there any way that I can change it and leave the rest of colours as they are? Or is there a way I can make my own colorscheme that uses 16 ANSII colours of my terminal? enter image description here

  • 1
    Check :h hl-LineNr
    – klaus
    Apr 2 '19 at 16:26

As @klaus mentioned, you want to change the highlight for the group LineNr.

In your .vimrc, you can change the color of a group with the following:

highlight LineNr ctermfg=33

ctermfg is the variable for a foreground color when using Vim in terminal. There are other options (background, bold, italic...), all described in the highlight help (:h highlight).

The number (33 in my example) is the color (from 0 to 255), you can find the list of available colors here for example: https://github.com/guns/xterm-color-table.vim

  • Thanks a lot! I have set it to 8 as this is the value for "dark grey" colour of my terminal profile.
    – Victor
    Apr 2 '19 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.