How to make gVim automatically maximize it's window when I open it? And a cross-plataform solution, I'm trying to use the same configs in a Linux and Windows machine...

I've tried the hack :set lines=999 columns=999, it almost works, but the window is not maximized, just resized and I lose some rows/columns.

link|improve this question

3  
That's the most portable way I know. Could you elaborate on the "but the window is not maximized, just resized and I lose some rows/columns". Maximization is afaik, resizing till the edges. And I don't think I ever lost a row/col in that way. – ldigas May 12 '10 at 19:04
@Idigas: correct, maximization is just "resize till it fills up available space (not covering toolbars etc)", in terms of wm-speak :) – akira May 13 '10 at 7:39
Setting the hack above doesn't resize till the edges. I'm starting to think the better approach is going to add an if in my vimrc: if it'd windows, call a config, else, call other config. – Somebody still uses you MS-DOS May 13 '10 at 12:15
feedback

4 Answers

From the Vim wiki:

au GUIEnter * simalt ~x

That'll work on Windows; I'm not sure what key combinations you'd need on Gnome/KDE.

link|improve this answer
This didn't work for me on Windows 7 Ultimate. – mattalexx Feb 18 '11 at 20:01
It also depends on the OS language sadly. For French Windows versions, it becomes au GUIEnter * simalt ~n. – ereOn Sep 7 '11 at 11:52
feedback

You can use maximize.dll plugin for fullscreen veiw on Vim (if you are using Windows). Just copy maximize.dll into vimdirectory/plugin folder.

link|improve this answer
feedback

For me, :simalt ~x did the trick. (Windows 7, English.)

link|improve this answer
Thanks, none of the other options worked on win7. – Chris Mar 14 at 20:59
feedback
up vote 1 down vote accepted

The best way if you're concerned about cross-plataform is using :set lines=999 columns=999. I've found it in Vim's Wiki, wasn't so satisfied about it, buy if cross-plataform is a must, them this the solution.

link|improve this answer
Can you combine this with au GUIEnter * simalt ~x ?? – snitzr Jun 9 '10 at 1:34
Yes, creating a condition in your vimrc to know if it's windows or Linux. Since I'm mainly using Linux, I'm going to add this config later. – Somebody still uses you MS-DOS Jun 9 '10 at 12:22
This approach does not work for me under GNOME 3. When the window was already non-maximized, this will slow down Vim for a little while (does not happen when I maximize using the window manager), and it will leave a little edge above the window uncovered, because my screen height is not a perfect multiple of line height. When the window was vertically (but not horizontally) maximized by dragging the window to the left or right of the screen, this will have no effect. – Andres Riofrio May 2 at 20:40
feedback

Your Answer

 
or
required, but never shown

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