On 2009-11-17, Frank Shute wrote:
> On Fri, Nov 13, 2009 at 08:24:07PM -0800, Jason wrote:
> >
> > 
> > I would like to set the initial window size and position of Gvim in
> > Ubuntu. In my .vimrc file, I have:
> > if has("gui_running")
> >   " GUI is running or is about to start.
> >   " Maximize gvim window.
> >   set lines=99 columns=100
> > else
> >   " This is console Vim.
> >   if exists("+lines")
> >     set lines=99
> >   endif
> >   if exists("+columns")
> >     set columns=100
> >   endif
> > endif
> > 
> > I tried adjusting these numbers but it does not seem to change the
> > size of Gvim window. Any hints for me?
> > 
> > Thank you.
> 
> I found the easiest way is to just set an alias in your shells rc and
> use the geometry argument.
> E.g In ~/.bashrc:
> 
> alias gvim="gvim -geom 80x30"
> 
> PS. Are you sure you want so many lines and columns? Your console is
> likely to only be 80x25

In some consoles and in gvim, setting 'lines' and 'columns' to huge
numbers will cause [g]vim to resize its window to the size of the
display.  In some cases, you have to use values of 'lines' and
'columns' that are only slightly larger than the maximum window size
or vim's display will become corrupted.

The problem with setting -geometry is that you can't change it from
within vim.  I am currently using a mapping that toggles the window
size between 80x24 or 80x25 and full-screen.  It works in gvim and
in most of the terminals I've tried.  It even works in the Windows
Command Prompt, which I find amazing since the Command Prompt
window's own maximize button doesn't even do that.

Regards,
Gary



--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to