VIM initial settings: change background color for line number on the left side?

前端 未结 4 1357
感动是毒
感动是毒 2021-01-31 08:41

I use _vimrc to configure my vim 7.2 (windows) default settings. One setting \"set number\" will display line numbers on the left side. My vim background color is w

相关标签:
4条回答
  • 2021-01-31 09:21
    highlight LineNr ctermfg=grey ctermbg=white
    
    0 讨论(0)
  • 2021-01-31 09:27

    To make the line number column transparent (the same color as the main background) you can try setting this in your .vimrc:

    highlight clear LineNr
    

    You can also clear the so-called sign column (used by gitgutter, etc) as well:

    highlight clear SignColumn
    

    This way, no matter what color scheme you use, both columns' background will be compatible.

    0 讨论(0)
  • 2021-01-31 09:29

    In my _vimrc, here is the setting:

    highlight LineNr guibg=grey
    

    or

    hi LineNr guibg=grey
    

    I don't need to set fore-color, the default is yellow and it is OK for me.

    0 讨论(0)
  • 2021-01-31 09:30

    guibg and guifg are for vims which are not in terminal. For terminal you use ctermfg ctermbg. Usually in GUI vims you have more colors support and you simply want to avoid the background. So I usually use this:

    highlight LineNr guibg=NONE
    
    0 讨论(0)
提交回复
热议问题