17

I recently updated my gVim to version 8 compiled with gtk 3, and I found there are strange inner borders around the gVim window:

gVim 8 white borders

This picture may not very clear but if you look carefully you can see the white borders on the right side and the bottom. I have solved this issue by setting a dark color to the border on gtk 2, but on gtk3 it happends again. Any idea of removing this border completely on gtk 3?

Jian
  • 3,118
  • 2
  • 22
  • 36

2 Answers2

27

Gtk3 uses css to style applications. To remove the white border from the gVim window, edit the file ~/.config/gtk-3.0/gtk.css and enter the following:

@define-color YOUR_BACKGROUND_COLOR #rrggbb;

window#vim-main-window {
    background-color: @YOUR_BACKGROUND_COLOR;
}
proprefenetre
  • 292
  • 4
  • 3
  • 1
    Is it possible to remove the border instead of setting a dark color? – Jian Sep 29 '16 at 13:29
  • 2
    I don't know anything about GTK so I could be wrong, but I don't think so. It's not really a border but part of the GtkForm object that is contained in the GtkWindow. You can check the structure using `GTK_DEBUG=interactive gvim`. – proprefenetre Sep 29 '16 at 16:25
  • @theJian, have you success with this? – glutaminefree Dec 08 '16 at 09:44
  • @glutaminefree, No, I still haven't find a solution to remove this padding completely. Setting a dark background color to make this issue less annoying that's all I can do now. – Jian Dec 08 '16 at 11:36
  • The reason you can't remove the border is because vim always sizes in exact ratios of the fixed width font, and that rarely matches your window size if you can resize per-pixel, or if you maximize your window. So you're seeing the leftover pixels. – Yobert May 10 '17 at 15:59
  • 1
    After tinkering with GTK_DEBUG I found out I had to replace `window` with `GtkWindow`. Might be useful for others. – bobismijnnaam Sep 08 '17 at 13:34
  • @Yobert What is strange is that I can't resize my gvim-window per-pixel, but only in the grid defined by the character size. – red_trumpet Dec 16 '17 at 12:05
1

I created a plugin to solve this issue. But it is Windows only: github.com/gabr/FixGVimBorder

gabr
  • 203
  • 2
  • 8