[EMAIL PROTECTED] wrote:
Hi,

The :set lines=99999 columns=99999 does not really maxmize the Vim window.
Since there's still borders for the window, a maximized window have no
borders (AFAIK this is true for WinXP and KDE).

Since you are highly unlikely to use a Windows version other than English
and Chinese. The following method works:

    if has("gui_win32")       " NT Windows
        autocmd GUIEnter * :simalt ~x
    endif

Tony think the method is non-portable, that is true, if there's a portable
way to do the job, I will prefer the portable way. However, the :set
lines=99999 columns=99999 cannot do the same job as the :simalt can do, so
their must be a compromize. I would recommend the ":simalt" way until there
is a nature way for vim to cope with that.


":set lines=99999 columns=99999" expands the Vim screen to within approximately one character cell of the maximum. The full-screen size is usually not a multiple of the character cell so whatever method you use (even ":simalt" there has to be an unused "fraction" of a cell's height and width around the borders. With my usual settings in kde (1024x768 display with two-row taskbar at bottom, gvim with GTK2 GUI, menu, toolbar and text-style tab bar displayed, 'guifont' set to "SUSE Sans Mono 9"), there may be a one- or two-pixel empty space around my Vim screen but I don't notice it; the most noticeable thing is that the "maximize/unmaximize" button shows a single rectangle rather than two overlapping ones.

Actually I tried clicking that button and the result is surprising: clicking it repeatedly cycles between _three_ states: maximized with the button showing one rectangle, maximized (same size) with button showing two overlapping rectangles, and not maximized (about 50% width and 75% height).

":simalt ~x" relies on Alt-Space x being the menu shortcut key to maximize. In a French version of Windows (as the one I used to have) it would be ":simalt ~g" instead because the French version of Windows uses the g of Agrandir (rather than the x of Maximize) as the shortcut. Similarly for other languages and OSes. (The help for ":simalt" says {only for Win32 versions}; however I'm not on Windows and exists(":simalt") returns 2. Apparently that help page is outdated.)


Best regards,
Tony.

Reply via email to