Search code examples
vimvi

How to find the available colours for hi-ColorColumn in Vim


I need to set up a "colorcolumn" to indicate a length of 100 characters in vim (v7.4). Instead of using the default settings for "cterm", I would like to set a different colour.

Problem is, certain colour names I use, throw an error stating it is invalid.

E421: Color name or number not recognized: ctermbg=ivory guibg=blue 

How can I find the list of available colours for my terminal?


Solution

  • Open vim and run the below command. It will list the available list of colours.

    :so $VIMRUNTIME/syntax/colortest.vim
    

    I already have the below two lines added in my .vimrc file.

    ":set colorcolumn=100,80  (set multiple colorcolumn)   
    
    :set cc=100                                                                                         
    :hi ColorColumn ctermbg=lightcyan guibg=blue
    

    For someone curious, I found useful information in the below documentation.

    Vim Documentation Syntax