Number pane not being highlighted in vim dracula theme

♀尐吖头ヾ 提交于 2019-12-24 22:54:49

问题


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

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.


回答1:


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
    


来源:https://stackoverflow.com/questions/48945518/number-pane-not-being-highlighted-in-vim-dracula-theme

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!