Resize Window To Fit

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Resize Window To Fit

Paul-433
I have just installed kAtremer's excellent php_funcinfo script - great for
quickly finding out the correct order of a function's arguments! This opens a
window that contains the function explanation but it is only 20 chararacter's
wide, which is not enough to see the information properly.

(If you are reading, kAtremer, how about making the function description window
split-height across the whole viewport?)

I wonder if there is a way to 'resize-to-fit' a window, something like ctrl-w |
and ctrl-w _ but which will only resize the window just enough to fit whatever
is on the screen?

Thinking a bit more, would it then be possible to have the current window
dynamically change size as the user types stuff?

--

.
Reply | Threaded
Open this post in threaded view
|

Re: Resize Window To Fit

Mikołaj Machowski
Dnia ?roda 15 czerwiec 2005 18:40, Vigil napisa?:

> I have just installed kAtremer's excellent php_funcinfo script - great
> for quickly finding out the correct order of a function's arguments!
> This opens a window that contains the function explanation but it is
> only 20 chararacter's wide, which is not enough to see the information
> properly.
>
> (If you are reading, kAtremer, how about making the function description
> window split-height across the whole viewport?)
>
> I wonder if there is a way to 'resize-to-fit' a window, something like
> ctrl-w | and ctrl-w _ but which will only resize the window just enough
> to fit whatever is on the screen?

Of course :)
The only problem is to find the longest line in buffer.
Pseudo code:
<go to interesting buffer>
let i = 80  
while i > 20
   redir @a
   exe 'normal! g/^.\{'.i.',}/'
   if @a !~ <error message>
    let longest_line = i
        break
   endif
   redir END
   let i = i - 1
endwhile
exe 'normal! '.i.'wincmd |'
>
> Thinking a bit more, would it then be possible to have the current
> window dynamically change size as the user types stuff?

Would be possible with insert autocommand reacting for each keypress...

m.

--
LaTeX + Vim = http://vim-latex.sourceforge.net/
Vim-list(s) Users Map: (last change 15 May)
 http://skawina.eu.org/mikolaj/vimlist
CLEWN - http://clewn.sf.net