created February 22, 2005 · complexity basic · author Anthony Gorecki · version 6.0
After a week of trying to find a proper way to maximize a gvim window under KDE, using the vimrc file, the best solution that I was able to find was "pseudo-maximize", which still left extra space around the gvim window. As a result of this, I abandoned the Vim configuration file and began experimenting with KDE's window-specific settings. Ironically, the solution was fairly simple:
First, open a gvim window and press the maximize button. Vim will generally rescale the window after you do this, so you'll need to make sure that the window is in fact maximized, typically by pressing the maximize button a second time to achieve the desired effect. Another way is to manually resize until you get as close as you can to a maximum size.
Next, right click on the title bar: Advanced -> Window Specific Settings. Select the Window tab if it isn't the default.
Click on the Detect button, and click anywhere inside the gvim window. In the window that pops up, select "Use window class (whole application)" and click Ok.
From here, move over to the Geometry tab and check the Size box. Change "Do Not Affect" to Force. You'll note that the size to the right is the same as that of the maximized window, which is the correct value. If you choose "Apply Initially" instead of Force, you'll encounter the same rescaling problem that required you to press the maximize button twice in the first step.
Please make certain that you've followed all of the above steps, as you'll need to edit these settings manually to change them. They're located in ~/.kdeX.Y/share/config/kwinrulesrc and must be edited when KDE is not running in order to avoid being overwritten. If you are on 4.4 you can edit it via right clicking on the titlebar, then "configure window behavior", go to the "window specific" section, choose your settings and select modify. The above is tested with KDE 3.4 and 4.4 (named slightly differently in 4.4 but close enough). If you're still a few pixels away just continue to edit it until you get it perfect.
Click Ok at the bottom of the window, restart gvim and enjoy.