Search code examples
vimcustomizationvim-syntax-highlighting

Number pane not being highlighted in vim dracula theme


I am using dracula theme for vim and am not able to get the number pane, that is, the side panel which contains the line numbers, to be displayed in a sort of translucent manner. The preview image shows that it's possible.

How the terminal should look like

(source: draculatheme.com)

How it actually looks

To fix this issue, I think I need to configure some attributes accordingly, but being a beginner, I don't know which ones, therefore any help and guidance would be appreciated.

As a reference, these are my dotvim files.


Solution

  • The background of the line numbers column is set in the colorscheme to NONE for color terminals and #282a36 for GUIs:

    hi LineNr ctermfg=60 ctermbg=NONE cterm=NONE guifg=#6272a4 guibg=#282a36 gui=NONE
    

    From there you have three options:

    • Enable the 'termguicolors' option so that Vim uses the gui* attributes instead of the cterm* attributes.

      This is how the screenshot was taken but it will only work in select terminal emulators.

      See :help 'termguicolors'.

    • Edit the colorscheme directly:

      hi LineNr ctermfg=60 ctermbg=242 cterm=NONE guifg=#6272a4 guibg=#282a36 gui=NONE
      

      I've chosen 242 arbitrarily but you can choose whatever color you want in this chart

    • Override your colorscheme in your vimrc:

      function! MyHighlights() abort
          hi LineNr ctermfg=60 ctermbg=242 cterm=NONE guifg=#6272a4 guibg=#282a36 gui=NONE
      endfunction
      
      augroup MyColors
          autocmd!
          autocmd ColorScheme * call MyHighlights()
      augroup END
      colorscheme dracula