Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

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

share|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
    
This screenshot provided the answer in an indirect way... I had been using the everything-floating layout! So... it was basically just my stupidity. All is good now. –  Owen Feb 28 '13 at 4:29
add comment

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"
share|improve this answer
    
Worked great for me in Ubuntu 13.04! I had to create .gtkrc-2.0 though, as it didn't exist yet. –  Cory Klein Sep 30 '13 at 22:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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