Mr. Shawn H. Corey wrote:
A.J.Mechelynck wrote:
The portable way to maximize gvim at startup (well, with maybe at
times a one-character-cell rounding error in the size of the Vim
screen) is
if has("gui_running")
set lines=9999 columns=9999
endif
The above (which is in my .vimrc) used to work for me on Windows, and
still works for me now that I'm on SuSE Linux.
Like the 'guifont' setting (and maybe others), 'lines' and 'columns',
when set in the vimrc, are "remembered" by gvim, and applied at GUI
startup.
Yes, except for the help for columns:
'columns' 'co' number (default 80 or terminal width)
global
{not in Vi}
Number of columns of the screen. Normally this is set by the terminal
initialization and does not have to be set by hand. Also see
|posix-screen-size|.
When Vim is running in the GUI or in a resizable window, setting this
option will cause the window size to be changed. When you only want
to use the size for the GUI, put the command in your |gvimrc| file.
When you set this option and Vim is unable to change the physical
number of columns of the display, the display may be messed up.
Minimum value is 12, maximum value is 10000.
It's the part about messing up the display that concerns me. I have
tried this on other systems and sometimes it works and other times it
creates a window very much larger than the screen. Why it's there a
command to simply maximize the window?
The "messing up" mostly applies (IIUC) to Vim running in a non-resizable
console, such as /dev/tty where the number of lines and columns can only take
a discrete set of values, not independently of each other, and with 'columns'
often fixed at 80.
In the GUI, I have never had problems.
When gvim realizes that the user is "trying" to set more lines or columns than
the viewport can hold, it resizes its application window down.
See another reply in this thread about the fact that maximizing is a function
of the window manager, not of the application. (But then, why does ":suspend"
-- a Vim ex-command -- _minimize_ the app window?)
Best regards,
Tony.
--
I'm for peace -- I've yet to see a man wake up in the morning and say
"I've just had a good war."
-- Mae West