Can I add something to my .vimrc or .gvimrc to make gvim always start up in a maximized GUI window?
On linux with most window managers and wmctrl
installed you can maximize Gvim using the following command:
call system('wmctrl -i -b add,maximized_vert,maximized_horz -r '.v:windowid)
. Note: I am intentionally avoiding -b add,fullscreen
mentioned in man wmctrl
as it means different thing: at least in fluxbox that means that from now on this desktop you can see only either gvim or something else at a time, not both, and gvim is left without window decorations (not that I really care about them). E.g. if you popup yakuake* gvim disappears until yakuake hides.
* terminal emulator, pops like console in some FPS games
It looks like if you're using Windows, it's as easy as adding this line into your .vimrc:
au GUIEnter * simalt ~x
(type :help maximize
or :help win16-maximized
for details)
Apparently there's no standard way to do it on other platforms from your vimrc. The simplest trick without knowing which platform is to add
set lines=999 columns=999
to your .gvimrc. There are a few other tricks that can help at the Vim Wiki's Maximize or set initial window size page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With