On 17/06/10 21:11, Rob Foehl wrote:
I've been looking for a way to make my .vimrc slightly more portable
across machines with variously vendor-crippled vim packages, usually
approximating a "tiny" build. I've tried adding a :finish call before
anything that triggers exceptions, like so:

if !has('eval')
finish
endif

...but it seems that :finish is among the features omitted in some of
these builds! (The call generates an E319.) Are there any similarly
concise alternatives to just wrapping everything in has() blocks?

-Rob


Tiny builds have the :finish command all right, what they lack is expression-evaluation, which is needed for the :if statement. So, in a tiny build, the whole scope of an :if statement, from :if to :endif, is handled as a nestable comment, see ":help no-eval-feature".

To make sure your script isn't sourced by tiny builds, just wrap the whole script in ":if 1" ... ":endif".

OTOH, in order to have some statements interpreted _only_ by builds without expression evaluation, place them at the end of your script, this way:

        if 1
                finish
        endif
        " come here only with Vim builds without expression evaluation


Best regards,
Tony.
--
Cynic, n.:
        One who looks through rose-colored glasses with a jaundiced
eye.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to