Loading ...
Sorry, an error occurred while loading the content.

Re: Disabling the auto-resize behavior

Expand Messages
  • A. J. Mechelynck
    ... Whatever you do, gvim isn t programmed to hold a fractional number of lines and/or columns. Furthermore, different settings of guifont mean different
    Message 1 of 2 , Mar 2, 2005
    • 0 Attachment
      Anthony Gorecki wrote:
      > Hello,
      > In reference to tip 883 <http://www.vim.org/tips/tip.php?tip_id=883>:
      > I've been searching for a way to disable the default gvim window-resize
      > behavior, however neither the VIM documentation, Google nor the #vim IRC
      > channel has been able to provide me with a solution.
      > Regarding set (lines|columns), gvim automatically rescales the lines and
      > columns to the nearest whole number that will fit on the screen, thus if you
      > `set lines=999', you may end up with lines=140, leaving extraneous free space
      > below the window because there isn't enough space to evenly fit another line.
      > The method I suggested in the above tip tenuously forces gvim to maximize
      > itself properly, but the window behavior is unreliable and make-shift at
      > best. Using the lines and column settings isn't adequate in this case, as I
      > need a fully maximized window more than I require an even number of visible
      > lines and columns. Is there a way to force gvim to assume the largest
      > possible screen space without manually hitting the maximize button twice
      > after every new editor window is opened?
      > Thanks for your help.
      Whatever you do, gvim isn't programmed to hold a fractional number of
      lines and/or columns. Furthermore, different settings of 'guifont' mean
      different character heights and/or widths. But -- see below.

      IIUC, you say you "need" to see a half-line or a half-column if that is
      what it takes to bring the edges of the Vim window to the edges of the
      W32 or X11 screen all around. I don't understand that "need".

      This said, in some versions of the GUI you can use the 'guiheadroom'
      option (q.v.), but since it exists in only a few versions, you should
      check if it is functional, for instance with "if exists('+guiheadroom')".

      However, ":set lines=99999 columns=99999", possibly preceded by ":if
      exists(":winpos") == 2 | winpos 0 0 | endif" is the most portable
      solution known to me: AFAIK, it works identically in all GUI versions
      and even in some console versions.

      A further possibility, where the ":simalt" command is supported, is to
      use (for instance in French Windows, where the "Maximize" menu item of
      the System menu is "A&grandir") ":simalt ~g". As you see, the problem is
      that you need the proper letter in the OS's current menu language, which
      makes this solution not portable across OS language settings.

      Best regards,
    Your message has been successfully submitted and would be delivered to recipients shortly.