On 4/22/06, Anton <[EMAIL PROTECTED]> wrote:
> Im'sorry for my simple question, but I'm newbie in using vim and just
> reying to create my own vimrc file
> The problem is:
> I want to enable option 'number' only if i run vim in a framebuffer, so
> I hawe to check screen size, I have no idea how to do that. I tried
>
> if columns=128
>     set number
> endif

if &columns == 128
    set number
endif

> And else I want to map a key to switch this ooption manualy:
>
> function! Numeration ()
> if exists("number")
>     set nonumber
> endif
> if !exists("number")
>     set number
> endif
> endfunction
>
> map <F2> :execute Numeration()<CR>
>
> But it only enables the option, and doesn't disable.
>
> What can I do to make it work?

map <F2> :set nu!<cr>

Yakov

Reply via email to