gvlasov
gvlasov

Reputation: 20035

Paddings around the actual vim window in gvim

In gvim small paddings on the right and bottom sides of a window can appear. Particularly when gvim window is maximized. For example, here is what my bottom-right corner of gvim looks like when I maximize gvim window:

https://i.sstatic.net/6HYiS.jpg

So is there anything I can do with these paddings? For example, move the actual editing area so paddings spread evenly from all four sides of gvim window instead of being only from two sides. Does any section of the manual contains the description of them? There is no real issue here, I'm just curious.

EDIT: I'm asking about the Linux version of gvim. I don't know how gvim behaves in similar situation in Windows or on Mac.

Upvotes: 4

Views: 2693

Answers (4)

Casey Jones
Casey Jones

Reputation: 153

Put this in your .gvimrc:

set ghr=0

:help guiheadroom

'guiheadroom' 'ghr'     number  (default 50)
                        global
                        {not in Vi} {only for GTK and X11 GUI}
    The number of pixels subtracted from the screen height when fitting
    the GUI window on the screen.  Set this before the GUI is started,
    e.g., in your gvimrc file.  When zero, the whole screen height will
    be used by the window.  When positive, the specified number of pixel
    lines will be left for window decorations and other items on the
    screen.  Set it to a negative value to allow windows taller than the
    screen.

I was tipped off to this solution on ArchWiki.

Upvotes: 2

romainl
romainl

Reputation: 196781

A common fix is to "hack" GTK so that GVim's window background is the same color as the background of your colorscheme. It's obviously less than ideal (you'd have to change it each time you try a new colorscheme) but it works reliably.

Put this code:

style "vimfix" {
  bg[NORMAL] = "#202020" # this matches my gvim theme 'Normal' bg color.
}
widget "vim-main-window.*GtkForm" style "vimfix"

in this file:

~/.gtkrc-2.0

Upvotes: 10

CrazyCasta
CrazyCasta

Reputation: 28362

Well, the reason it's there is because windows is forcing it to a size other than it's normal size plus an integer number of character sizes. As far as I know the people who wrote gvim didn't bother to add a centered option.

Upvotes: 1

Conner
Conner

Reputation: 31070

You can adjust the lines and columns options. For example:

:set lines=1000
:set columns=1000

You can find out about these with :help lines and :help columns.

Upvotes: 1

Related Questions