On 16/04/09 14:20, Visco Shaun wrote:
>
> Hi
>
> Is there any way to adjust automatically the window size so that we have
> a fixed no of char-width(say 80) even though the number of digits of
> lineno(by 'set no') shown on left changes.
>
> At present I am using command 'winsize 83 51' assuming the maximum
> lineno to be a 3 digit no.
>

AFAIK, there isn't, but you can set 'numberwidth' to a large enough 
value to avoid overflow, making the numbers column fixed-width. Remember 
that the numbers column, with width no less than 'numberwidth', has its 
last column always empty, i.e., with set nuw=5 you'll be able to display 
files of up to 9999 lines without overflow, then the number-column width 
will increase.

If you know that, let's say, all of your files are less than 100,000 
lines long, you can use

        :set nu nuw=6 columns=86 lines=9999

which will set the gvim screen to 80 "usable" columns, a 6-column 
"numbers" column (for line numbers 1-99999 right-justified with 
spacefill to the left, and one space to the right) and as many lines as 
the desktop will allow for your chosen 'guifont' (note: the ":winsize" 
command is documented as obsolete).

(My longest text file is slightly more than one million lines -- a 
_very_ long file, 33Mb for a single file, and I didn't write it myself; 
I downloaded it. I maximize gvim both horizontally and vertically, and I 
only rarely set 'numbut if I wanted a fixed-width "numbers" column even 
for this file, I would have to set 'numberwidth' to 8.)


Best regards,
Tony.
-- 
"God gives burdens; also shoulders"

Jimmy Carter cited this Jewish saying in his concession speech at the
end of the 1980 election.  At least he said it was a Jewish saying; I
can't find it anywhere.  I'm sure he's telling the truth though; why
would he lie about a thing like that?
                -- Arthur Naiman, "Every Goy's Guide to Yiddish"

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

Reply via email to