Can gvim 6.3 not remember last window size?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Can gvim 6.3 not remember last window size?

vudghkzm
Hello, everyone.

I am using gvim 6.3 under MS windows 2000 professional.
But gvim 6.3 can not remember last window size.
It always has fixed window size.
May be I think that size is 80 x 24.

I want that gvim 6.3 remember last window size.
How can I do that?

And I have one more question.
Is it possible that resizing window size of gvim 6.3 without using
mouse? I want to resize window size of gvim 6.3 using only keyboard.
How can I do that?

Sincerely, Good-bye.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can gvim 6.3 not remember last window size?

panshizhu
It is not possible to "remember" last window size.

However, you can set the initial size for everytime vim start in .gvimrc
(should be something like set columns=999)

I just maximize the window, use the following in .vimrc:
    if has("gui_win32")       " NT Windows
        autocmd GUIEnter * :simalt ~x
    endif
Then the vim will be maximized at start everytime.

--
Sincerely
Pan, Shizhu. ext: 2221




vudghkzm <[hidden email]> wrote on 2005-05-27 08:35:31:

> Hello, everyone.
>
> I am using gvim 6.3 under MS windows 2000 professional.
> But gvim 6.3 can not remember last window size.
> It always has fixed window size.
> May be I think that size is 80 x 24.
>
> I want that gvim 6.3 remember last window size.
> How can I do that?
>
> And I have one more question.
> Is it possible that resizing window size of gvim 6.3 without using
> mouse? I want to resize window size of gvim 6.3 using only keyboard.
> How can I do that?
>
> Sincerely, Good-bye.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can gvim 6.3 not remember last window size?

A.J.Mechelynck
In reply to this post by vudghkzm
vudghkzm wrote:
> Hello, everyone.
>
> I am using gvim 6.3 under MS windows 2000 professional.
> But gvim 6.3 can not remember last window size.
> It always has fixed window size.
> May be I think that size is 80 x 24.
>
> I want that gvim 6.3 remember last window size.
> How can I do that?

see at bottom

>
> And I have one more question.
> Is it possible that resizing window size of gvim 6.3 without using
> mouse? I want to resize window size of gvim 6.3 using only keyboard.
> How can I do that?

see
        :help 'lines'
        :help 'columns'

>
> Sincerely, Good-bye.
>
>
>


To remember the size of the Vim window:

Add this (from <<<<< to >>>>> excluded) to your vimrc (works in gvim,
not console Vim)

<<<<<
" remember window size and (if possible) position
au GUIEnter * if filereadable("~/savesize.vim") source ~/savesize.vim
function SaveSizes()
        let x0 = getwinposx()
        let y0 = getwinposy()
        let x1 = &columns
        let y1 = &lines
        redir! > ~/savesize.vim
        echo 'if exists(":winpos") == 2'
        echo "\t:winpos" x0 y0
        echo "endif"
        echo "set columns=" . x1
        echo "set lines=" . y1
        redir END
endfunction
au VimLeave * if has("gui_running") | silent call SaveSizes() | endif
>>>>>

see
        :help :autocmd
        :help GUIEnter
        :help VimLeave
        :help getwinposx()
        :help getwinposy()
        :help :winpos
        :help exists()
        :help 'lines'
        :help 'columns'
        :help has()
        :help feature-list
etc.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can gvim 6.3 not remember last window size?

A.J.Mechelynck
In reply to this post by panshizhu
[hidden email] wrote:
> It is not possible to "remember" last window size.
[...]
oh, but it is, with a little bit of fancy footwork: see my post of a
minute or two ago.


Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can gvim 6.3 not remember last window size?

Steve Hall-4
On Fri, 2005-05-27 at 03:26 +0200, A. J. Mechelynck wrote:
> [hidden email] wrote:
> > It is not possible to "remember" last window size.
> [...]
> oh, but it is, with a little bit of fancy footwork: see my post of a
> minute or two ago.

Another way (other than your suggested redirection of these settings
into file) is to simply store them in an uppercase global variable and
use a viminfo:

  :help viminfo
  :help variables [near bottom of section]

Then on startup, these vars can be used to reset the window position
via GuiEnter autocmd event. (This will cause a quick window flutter as
the window re-positions and can't be helped because the globals aren't
available before the initial window open.)


--
Steve Hall  [ digitect mindspring com ]
:: Cream... something good to put in your Vim!
::   http://cream.sourceforge.net


Loading...