Friday, June 18, 2010

Re: alternatives to :finish

On Fri, 18 Jun 2010, Tony Mechelynck wrote:

> 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".

Thanks, Tony. It'd occurred to me that :if must be special-cased in -eval
builds, I just hadn't discovered exactly how.

That said, I have found at least two vendor builds which omit :finish
entirely, confirmed by attempting to load a .vimrc consisting solely of:

set nocompatible
finish
quit

The builds in question load this as follows:

$ vi
Error detected while processing /home/rob/.vimrc:
line 2:
E319: Sorry, the command is not available in this version: finish
$

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

I'd actually been attempting something more complex -- the !has('eval')
case was the simplest I'd tried, but I think I can get away with the ":if
1" method as a baseline test easily enough.

Thanks!

-Rob

--
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

No comments: