Friday, October 2, 2020

Re: vimrc: identify "small" version vs "huge" version

On 2020-10-02, ping song wrote:
> experts:
> I found in centos 7 there is /usr/bin/vi and /usr/bin/vim, with same version,
> patches.
> but vi is the "small" version and "vim" is the huge one. 
> obviously both will use same .vimrc, and when vi is used a lot of errors pop up
> because of the much less features compiled.
> how do I differ these two in  my .vimrc file?

Unfortunately, the small version does not include the +eval feature,
which means that you can't use :if/:else/:endif along with has() in
the usual manner to skip features in your vimrc that your vim
doesn't support. However, without the +eval feature, vim will
simply skip over any :if/:endif construct it finds. Therefore, you
can still use :if/:endif to avoid commands and options that the
small version doesn't understand. (You can't use :else here.
Without the +eval feature, vim will also skip over :else blocks.)

For example:

if eval
set some_option_not_in_small_version
endif

See

:help :version
:help :if

Regards,
Gary

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20201002170426.GA17599%40phoenix.

No comments:

Post a Comment