Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
set lines=999 columns=999

doesn't work, and

au GUIEnter * simalt ~x

only works for Windows.

share|improve this question
What WM are you using? – Rob Sep 14 '11 at 16:40

It's your window manager who takes care about setting the initial window size. To get gvim maximized, you need to convince him to do that. This does of course depend on the window manager used.

Alternatively, define a window manager shortcut to maximize windows and use that after starting gvim.

share|improve this answer

You can do that in Linux by setting 'lines' and 'columns' to large values, but for some reason they can't be arbitrarily large. I found I had to set each of them to either the same values as a maximized window or slightly larger. For example, setting lines=99 worked for me.

share|improve this answer

One option is to run GVim using the following script:

exec=/usr/bin/gvim #here you can modify the location of gvim
$exec -f $* &
while [ -z $winid ]; do
  sleep 0.05
  winid=`wmctrl -pl |grep -P "^0x[0-9a-f]+[ ]+[-0-9]+[ ]+$pid" | cut -f1 -d' '`
# echo "debug: $exec started, PID=$pid, Window ID=$winid"

#this maximizes the GVim window
wmctrl -i -b add,maximized_vert,maximized_horz -r $winid

#this switches the GVim window to fullscreen
wmctrl -i -b add,fullscreen -r $winid

If you want to have this as the default whenever you call gvim, you can, e.g., save this script as /usr/local/bin/gvim.

share|improve this answer

You must log in to answer this question.

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