Highlight definitions for vim-gitgutter #62

wants to merge 3 commits into


None yet
8 participants

jwhitley commented Mar 5, 2013

This change adds support for vim-gitgutter highlight definitions. It also changes the SignColumn background to be the same as LineNr, as suggested in #26, for visual consistency when both gitgutter and line numbering are active.

jwhitley commented Mar 5, 2013

Arguably SignColumn should use hi! link SignColumn LineNr instead of what I've got above. I based my first commit off of #26, but now see that a first-class link appears preferable.

For everyone else who comes across this and wants a fix immediately, you can add highlight clear SignColumn to your vimrc. It will use the same color as your line number column.

tlvince commented Apr 7, 2013

If using the toggle background function, the hunk marker colours are lost. Could you confirm @jwhitley?

Edit: vim-gutter#77 fixes this.

Also, I think this looks even neater using hi! link SignColumn Background (like in vim-gutter's screenshot). Thoughts?

airblade commented Apr 8, 2013

@tlvince In the screenshot vim-gitgutter is linking SignColumn to LineNr.


I tried adding hi! link SignColumn Background to my .vimrc; but it doesn't seem to have worked; I still get a fugly-ass grey gutter on new vims. I even tried this:

autocmd ColorScheme * highlight link SignColumn LineNr

Unfortunately, no dice:

… maybe I'm just doing something idiotic? I don't know; I'm anything but a vim wizard. This is atrociously ugly though, I want to get it fixed as soon as possible!

autocmd ColorScheme * highlight clear SignColumn

works for me:)

wish this pull-request will be merged ASAP.


Only using the line above in vimrc will work only when you change your colorscheme. The following is what I finally added to my vimrc
highlight clear SignColumn
autocmd ColorScheme * highlight clear SignColumn

PhilT commented Jul 27, 2013

I found I just needed:

highlight SignColumn ctermbg=8

after the line:

colorscheme solarized

As I wanted the sign column to be the darker background color. This makes it the same background color as lines with the signs (and doesn't make the line numbers column look odd).

Awesome @PhilT, that worked, many thanks. 🤘

Here's an improved version, combining @ShengYun's observation, and @airblade's about LineNr:

" ... until https://github.com/altercation/vim-colors-solarized/pull/62
fun! FixSignColumn()
   highlight clear SignColumn
   highlight link SignColumn LineNr

call FixSignColumn()
au ColorScheme * call FixSignColumn()

I'm no VimScript expert; this can probably be condensed, but, whatever. :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment