Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.
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
add comment

3 Answers

One option is to run GVim using the following script:

#!/bin/bash
exec=/usr/bin/gvim #here you can modify the location of gvim
$exec -f $* &
pid=$!
winid=""
while [ -z $winid ]; do
  sleep 0.05
  winid=`wmctrl -pl |grep -P "^0x[0-9a-f]+[ ]+[-0-9]+[ ]+$pid" | cut -f1 -d' '`
done
# 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
add comment

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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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