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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

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

ping song
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?

thanks.

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAHyaFsVi_K3Xf_6pwGXyYHxu1d-PV3ahP_m5Mkt6BOuqjkxXSg%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

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

Richard Mitchell


On Friday, October 2, 2020 at 11:34:49 AM UTC-4, ping 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?

thanks.

Does:

:echo v:progname

show a different answer between the two? 

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/41c054cd-7e49-436f-944e-900eb26fb61do%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

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

Richard Mitchell
In reply to this post by ping song


On Friday, October 2, 2020 at 11:34:49 AM UTC-4, ping 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?

thanks.

Does

echo v:progname

show a different result?
 

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/96d6d9c0-0373-43be-871e-24baf4981f99o%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

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

Gary Johnson-4
In reply to this post by ping song
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20201002170426.GA17599%40phoenix.
Reply | Threaded
Open this post in threaded view
|

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

John Little-4
In reply to this post by ping song
On Saturday, October 3, 2020 at 4:34:49 AM UTC+13, ping wrote:

I found in centos 7 there is /usr/bin/vi and /usr/bin/vim, with same version, patches.

I was using a new centos 7 instance this week, and the version of vim was old, 7.4, and very minimal.  The centos 7 repositories do not have a more recent version.

I followed the instructions at https://phoenixnap.com/kb/how-to-install-vim-centos-7, except I did not remove anything, and did not include any of the interpreter stuff.  It was quick and painless, now have a "huge" vim 8.2.

Regards, John Little

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/ad1affb3-76fb-4d63-9211-734800709a5co%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

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

Tony Mechelynck
In reply to this post by ping song
On Fri, Oct 2, 2020 at 5:34 PM ping song <[hidden email]> 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?
>
> thanks.

The most important diference is that the "small" and "tiny" versions
are compiled without the +eval feature. A possible solution takes
advantage of the fact that in -eval builds, the :if .. :endif complex
statement becomes a nestable comment: so if you add "if 1" at the
start of your vimrc and "endif" at the end, everything in between will
be ignored by the "small" version.

If that seems too much for you, you could write at the top a few
unconditional statements compatible with the "small" version (see
:help +feature-list and use only features preceded by S or T) then
after that write "if 1" alone on a line, any statements to be
interpreted only by builds compiled with +eval, and finally "endif",
again alone on its line.

Best regards,
Tony.

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXvGe9%3DdbnRH5xAsJGWrQ-h0ku30aW2NFmxcuNTZPB46rg%40mail.gmail.com.