Changing vim 'gutter' color

Vim

Vim Problem Overview


See the screenshot of how I have vim configured below. The 'gutter' i.e. where the '+' and '~' symbols appear show my git status using this amazing sublime text port for vim: https://github.com/airblade/vim-gitgutter

How do I change the color of the gutter where there are no '+'/'~' symbols? I.e. the grey part? This is how you change the number column: https://stackoverflow.com/questions/250652/vim-initial-settings-change-backgound-color-for-line-number-on-the-left-side but I can't find how to change the 'gutter' color.

Any ideas?

Many thanks.

Vim Solutions


Solution 1 - Vim

This "gutter" is called the signs column. (See :help signs for more information.) The highlight group associated with this column is called SignColumn, and can be set like this (using the example from the help section):

:highlight SignColumn guibg=darkgrey

Solution 2 - Vim

To change the color in your ~/.vimrc so that your gutter is the same color as where your line numbers show up is the following:

highlight clear SignColumn

enter image description here

The git-gutter docs have some other helpful suggestions.

Solution 3 - Vim

Another option that hasn't been mentioned is to eliminate the sign column entirely and put the signs into the number column.

Adding this to your ~/.vimrc

set signcolumn=number

produces

signs in number column

(this is using custom symbols with the Ale plugin in iterm Vim).

This is available in "full" Vim versions 7.4.2201 or newer that include the +signs feature (I use the version installed by Homebrew on MacOS).

Solution 4 - Vim

From the screenshot, I think you're using https://github.com/altercation/vim-colors-solarized/ as your colorscheme, as I was. Another solution for this particular case is to switch to https://github.com/ericbn/vim-solarized, as @altercation's version has a bunch of open PRs fixing that very issue and no changes in the last decade.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionaleView Question on Stackoverflow
Solution 1 - VimPrince GoulashView Answer on Stackoverflow
Solution 2 - VimPeter AjtaiView Answer on Stackoverflow
Solution 3 - Vimapostl3polView Answer on Stackoverflow
Solution 4 - VimDominik StańczakView Answer on Stackoverflow