On 27/03/09 18:07, Ivan Van Laningham wrote:
> Hi All--
> I've tried several ways, but none of them seem to work.  I think this
> _ought_ to work:
>
>    let mylines="$VIM_LINES"+0
>    let mycolumns="$VIM_COLUMNS"+0
>    set lines=mylines
>    set columns=mycolumns
>
> but when I edit a file I get:
>
> Error detected while processing /home/ivanlaningham/.gvimrc:
> line   29:
> E521: Number required after =: lines=mylines
>
> Clearly I don't understand what I'm doing.  Can anyone explain what I'm
> missing?
>
> Metta,
> Ivan

The ":set" command only takes a literal value after the equal sign, not 
a variable and not an expression. Here you're telling Vim to set 'lines' 
to the value "mylines" (not the value of the mylines variable) which is 
illegal for that numeric option.

The following ought to work:

        if $VIM_LINES != ""
                let &lines = $VIM_LINES
        endif
        if $VIM_COLUMNS != ""
                let &columns = $VIM_COLUMNS
        endif

see :help :let-option

Alternately, you could also, in bash,

        export VIM_POSIX=1
        export LINES=60
        export COLUMNS=80
        vim

or in cmd.exe,

        set VIM_POSIX=1
        set LINES=60
        set COLUMNS=80
        vim

(In POSIX mode, $LINES and $COLUMNS override what system-specific 
commands tell Vim about the size of the terminal: see ":help cpo-bar" 
which is the last of the POSIX flags in 'cpoptions'.)


Best regards,
Tony.
-- 
My love runs by like a day in June,
        And he makes no friends of sorrows.
He'll tread his galloping rigadoon
        In the pathway or the morrows.
He'll live his days where the sunbeams start
        Nor could storm or wind uproot him.
My own dear love, he is all my heart --
        And I wish somebody'd shoot him.
                -- Dorothy Parker

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

Reply via email to