I know this is a common problem but I've never found an answer that really works.

When I start up gvim, the following sequence of events takes place:

  • GVim window opens
  • A rule in my rc.lua sets maximized_vertical and maximized_horizontal, causing the window to fill the screen
  • GVim reacts to the change by shrinking to an even number of characters
  • ~/.vimrc runs and set guioptions-=m removes the menu bar, further shrinking the window.

There is now a substantial gap below the window. Even re-maximizing it still leaves some gap, though smaller.

Ideally, I would like a way to force the window geometry to be fixed, and not allow GVim to resize the window, no matter how much it wants to (those few times when it's nice for GVim to resize are not worth the times when it's not).

Can this be done?

link|improve this question

80% accept rate
feedback

2 Answers

Not sure from your description, but you may be having the problem I was... that GVim takes the background color from the GTK theme for the extra space.

Solution that worked for me (from the Arch Wiki), add the following to ~/.gtkrc-2.0:

style "vimfix" {
  bg[NORMAL] = "#242424" # this matches my gvim theme 'Normal' bg color.
}
widget "vim-main-window.*GtkForm" style "vimfix"
link|improve this answer
feedback

This is a size hint issue. Add this to rc.lua:

{ rule = { class = "Gvim" }, properties = { size_hints_honor = false } },

I have the same thing done for XTerm and URxvt classes.

My gvim

link|improve this answer
Sorry, I forgot to add I already have size_hints_honor set to false for all windows... but I'll try adding a Gvim-specific rule and see if anything changes. – Owen Oct 18 '11 at 18:22
No, nothing changes. – Owen Oct 18 '11 at 18:23
What is your awesome version? You should probably post your whole rc.lua in a pastebin or whatnot. – lkraav Oct 18 '11 at 21:21
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.