3

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?

2 Answers 2

1

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

4
  • 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
    Commented Oct 18, 2011 at 18:22
  • No, nothing changes.
    – Owen
    Commented Oct 18, 2011 at 18:23
  • What is your awesome version? You should probably post your whole rc.lua in a pastebin or whatnot.
    – lkraav
    Commented Oct 18, 2011 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
    Commented Feb 28, 2013 at 4:29
5

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"
1
  • Worked great for me in Ubuntu 13.04! I had to create .gtkrc-2.0 though, as it didn't exist yet.
    – Cory Klein
    Commented Sep 30, 2013 at 22:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .