Search code examples
neovimcolor-schemepyright

nvim : color of the lateral warning bar (EdenEast/nightfox)


If it matters, I am using the colorsheme EdenEast/nightfox with nvim : Plug 'EdenEast/nightfox.nvim' in init.vim.

I want to colorize the lateral when pyright detects an error.

More specifically, I am speaking of the vertical lateral bar in which pyright adds >> on the lines containing errors.

I want that bar to be fully colorized when there is an error anywhere in the file.

The SignColumn


Solution

  • The secret is SignColumn.

    Here is the portion of code (in init.vim) which changes the color of the sign column when an error is detected:

    function! ShowDiagnostics()
        let diagnostics = CocAction('diagnosticList')
        if !empty(diagnostics)
            highlight SignColumn guibg=#00ff56
        endif
    endfunction
    
    autocmd BufWritePost *.py call ShowDiagnostics()