Vim Tips Wiki
Advertisement

Previous TipNext Tip

Tip: #88 - Maximize or set initial window size

Created: July 14, 2001 19:01 Complexity: basic Author: Leif Wickland (leifw at bigfoot , com) Version: 5.7 Karma: 149/61 Imported from: Tip#88

Maybe it's just because I have far too small of a monitor, because I can get distracted while coding if I have other stuff on the screen, or because I starting using vim on a console, but I definitely like my vim window maximized. Anyway, sticking the following in your vimrc will always maximize your vim window on startup.

au GUIEnter * simalt ~x 

:help win16-maximized

Comments

In Windows, you can control this from your VIM shortcut (and even add a keyboard shortcut that will bring up VIM from anywhere.) Right click on your Icon select properties and fiddle with the Run and Short cut key entries. I use Shift-Control-Alt-V to start VIM from anywhere. If VIM is already running this will switch to the most recently used instance of VIM.

bindu--AT--wavell.net , November 11, 2001 13:20


anyone know how to get this functionality to work in X with gvim? please email me if so...

kbgaddis--AT--hotmail.com , January 10, 2002 21:59


i dont know how to do this from vimrc. but it is a function of many windowmanagers, i am using windowmaker and i minimize vim, right click on vim icon, goto attributes, and click start maximized. i would guess many other windowmanagers can do this same thing.

libberspam--AT--atlaswebmail.com , February 8, 2003 11:36


Use for example: start /MAX "C:\Program Files\vim\vim61\gvim.exe"


mkruszec--AT--mops.uci.agh.edu.pl , March 17, 2003 5:42


In the same vein, you can specific a starting window size with:

set lines=50 columns=100

I have a 21" monitor at 1600x1200, and with a medium-to-small font I can fit 4 gvim windows side by side at 100x50 each and still have room for IM client, music player, etc., yet still have enough room in each window to actually do stuff. (I'm one of those "prefers a busy screen" freaks).

see :help winsize (which is depreciated, but the help's still there)


I wrote an utility which maximizes the Vim window, you call it from your _vimrc: http://vim.sourceforge.net/scripts/script.php?script_id=1302


Advertisement